summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index 3a5dc8b7d4..9793133f80 100644
--- a/struct.c
+++ b/struct.c
@@ -742,7 +742,7 @@ rb_struct_initialize_m(int argc, const VALUE *argv, VALUE self)
switch (rb_struct_s_keyword_init(klass)) {
default:
if (argc > 1 || !RB_TYPE_P(argv[0], T_HASH)) {
- rb_raise(rb_eArgError, "wrong number of arguments (given %d, expected 0)", argc);
+ rb_error_arity(argc, 0, 0);
}
keyword_init = true;
break;
@@ -1800,7 +1800,7 @@ rb_data_initialize_m(int argc, const VALUE *argv, VALUE self)
return Qnil;
}
if (argc > 1 || !RB_TYPE_P(argv[0], T_HASH)) {
- rb_raise(rb_eArgError, "wrong number of arguments (given %d, expected 0)", argc);
+ rb_error_arity(argc, 0, 0);
}
if (RHASH_SIZE(argv[0]) < num_members) {