summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2026-02-04 19:51:35 -0500
committerPeter Zhu <peter@peterzhu.ca>2026-02-04 19:55:23 -0500
commit10b6d543f98fc64b41eab9aceae57b498b093771 (patch)
treec45ab5eec74926043ba38402e695407186e30b16
parentbc849a185a96c032448fed787034eb4503c0cc10 (diff)
[DOC] Fix hash style in Array#to_h
-rw-r--r--array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/array.c b/array.c
index 4a4c44562d..90e83fd3ad 100644
--- a/array.c
+++ b/array.c
@@ -3163,7 +3163,7 @@ rb_ary_to_a(VALUE ary)
* forms each sub-array into a key-value pair in the new hash:
*
* a = [['foo', 'zero'], ['bar', 'one'], ['baz', 'two']]
- * a.to_h # => {"foo"=>"zero", "bar"=>"one", "baz"=>"two"}
+ * a.to_h # => {"foo" => "zero", "bar" => "one", "baz" => "two"}
* [].to_h # => {}
*
* With a block given, the block must return a 2-element array;
@@ -3172,7 +3172,7 @@ rb_ary_to_a(VALUE ary)
*
* a = ['foo', :bar, 1, [2, 3], {baz: 4}]
* a.to_h {|element| [element, element.class] }
- * # => {"foo"=>String, :bar=>Symbol, 1=>Integer, [2, 3]=>Array, {:baz=>4}=>Hash}
+ * # => {"foo" => String, bar: Symbol, 1 => Integer, [2, 3] => Array, {baz: 4} => Hash}
*
* Related: see {Methods for Converting}[rdoc-ref:Array@Methods+for+Converting].
*/