pub(crate) fn from<'a>(s: impl Into<Cow<'a, str>>) -> Self {
        let s = s.into();
        if s.len() <= SMALL_STRING_CAPACITY {
            RString::SmallStr(SmallString::from(&s).unwrap())
        } else {
            RString::Str(s.into_owned())
        }
    }
Converts an object of Cow<str> or &str or String to a RString::Str.
ruruby/src/value/string.rs