Skip to content

Commit bd94cb7

Browse files
committed
[DOC] Fix hash style in Array#to_h
1 parent bc849a1 commit bd94cb7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

array.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,7 +3163,7 @@ rb_ary_to_a(VALUE ary)
31633163
* forms each sub-array into a key-value pair in the new hash:
31643164
*
31653165
* a = [['foo', 'zero'], ['bar', 'one'], ['baz', 'two']]
3166-
* a.to_h # => {"foo"=>"zero", "bar"=>"one", "baz"=>"two"}
3166+
* a.to_h # => {"foo" => "zero", "bar" => "one", "baz" => "two"}
31673167
* [].to_h # => {}
31683168
*
31693169
* With a block given, the block must return a 2-element array;
@@ -3172,7 +3172,7 @@ rb_ary_to_a(VALUE ary)
31723172
*
31733173
* a = ['foo', :bar, 1, [2, 3], {baz: 4}]
31743174
* a.to_h {|element| [element, element.class] }
3175-
* # => {"foo"=>String, :bar=>Symbol, 1=>Integer, [2, 3]=>Array, {:baz=>4}=>Hash}
3175+
* # => {"foo" => String, bar: Symbol, 1 => Integer, [2, 3] => Array, {baz: 4} => Hash}
31763176
*
31773177
* Related: see {Methods for Converting}[rdoc-ref:Array@Methods+for+Converting].
31783178
*/

0 commit comments

Comments
 (0)