diff --git a/string.c b/string.c index 857d1e1085..abb099eda1 100644 --- a/string.c +++ b/string.c @@ -2874,14 +2874,16 @@ rb_check_string_type(VALUE str) * call-seq: * String.try_convert(object) -> object, new_string, or nil * - * If +object+ is a +String+ object, returns +object+. + * Attempts to convert the given +object+ to a string. + * + * If +object+ is already a string, returns +object+, unmodified. * * Otherwise if +object+ responds to :to_str, * calls object.to_str and returns the result. * * Returns +nil+ if +object+ does not respond to :to_str. * - * Raises an exception unless object.to_str returns a +String+ object. + * Raises an exception unless object.to_str returns a string. */ static VALUE rb_str_s_try_convert(VALUE dummy, VALUE str)