Fix wrong documentation
It doesn't return `nil` but raises an exception, as explained a few lines after
This commit is contained in:
parent
71ee05c936
commit
7de7d096e7
Notes:
git
2021-04-24 01:25:35 +09:00
1
hash.c
1
hash.c
@ -2120,7 +2120,6 @@ rb_hash_lookup(VALUE hash, VALUE key)
|
||||
* If +key+ is not found and no block was given,
|
||||
* returns +default_value+:
|
||||
* {}.fetch(:nosuch, :default) # => :default
|
||||
* {}.fetch(:nosuch) # => nil
|
||||
*
|
||||
* If +key+ is not found and a block was given,
|
||||
* yields +key+ to the block and returns the block's return value:
|
||||
|
Loading…
x
Reference in New Issue
Block a user