Unify mrb_str_to_str to mrb_obj_as_string.

Redirect `mrb_str_to_str` to `mrb_obj_as_string` via C macro.
Inspired by #5082
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-09-21 17:06:18 +09:00
parent bff79112a6
commit 896338e219
3 changed files with 20 additions and 25 deletions
+2 -1
View File
@@ -377,8 +377,9 @@ MRB_API double mrb_cstr_to_dbl(mrb_state *mrb, const char *s, mrb_bool badcheck)
/**
* Returns a converted string type.
* For type checking, non converting `mrb_to_str` is recommended.
* obsolete: use `mrb_obj_as_string()` instead.
*/
MRB_API mrb_value mrb_str_to_str(mrb_state *mrb, mrb_value str);
#define mrb_str_to_str(mrb, str) mrb_obj_as_string(mrb, str)
/**
* Returns true if the strings match and false if the strings don't match.