Unverified Commit e28ebed6 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4431 from shuujii/use-mrb_ensure_string_type-in-mrb_to_str

Use `mrb_ensure_string_type` in `mrb_to_str`
parents 4cce39ca fa317fab
......@@ -584,11 +584,7 @@ mrb_Float(mrb_state *mrb, mrb_value val)
MRB_API mrb_value
mrb_to_str(mrb_state *mrb, mrb_value val)
{
if (!mrb_string_p(val)) {
mrb_value type = inspect_type(mrb, val);
mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S to String", type);
}
return val;
return mrb_ensure_string_type(mrb, val);
}
/* obsolete: use mrb_ensure_string_type() instead */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment