my_hash[:'key'] = value
instead of my_hash.merge!('key': value)
.68
69my_hash = {}
70# Raises "Hash merging can be replaced by hash key assignment"
71my_hash.merge!('key': value)72
73
74# Raises "Use `size` instead of `count`"
It is more efficient to replace Hash#merge!
with Hash#[]=
.
hash.merge!(a: 1)
hash.merge!({'key' => 'value'})
hash[:a] = 1
hash['key'] = 'value'