summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index f2abc4fcf3..c97bfc8047 100644
--- a/string.c
+++ b/string.c
@@ -3616,7 +3616,7 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
}
else {
repl = argv[1];
- hash = rb_check_convert_type(argv[1], T_HASH, "Hash", "to_hash");
+ hash = rb_check_hash_type(argv[1]);
if (NIL_P(hash)) {
StringValue(repl);
}
@@ -3768,7 +3768,7 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
break;
case 2:
repl = argv[1];
- hash = rb_check_convert_type(argv[1], T_HASH, "Hash", "to_hash");
+ hash = rb_check_hash_type(argv[1]);
if (NIL_P(hash)) {
StringValue(repl);
}