From 7de7d096e77ddcc6789ddea3e8aeecfaa684dccb Mon Sep 17 00:00:00 2001 From: romainsalles Date: Fri, 23 Apr 2021 14:25:42 +0200 Subject: [PATCH] Fix wrong documentation It doesn't return `nil` but raises an exception, as explained a few lines after --- hash.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hash.c b/hash.c index 1498f30f5a..a36310209b 100644 --- a/hash.c +++ b/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: