[][src]Function kul::source_stream::to_rc_string

pub fn to_rc_string(s: String) -> Rc<String>

Simply putting a String in an Rc has the benefit that no moving of the string contents will ever occur, which is always very fast to construct.

But the disadvantages are: unused String capacity is not freed, which might be a problem if you keep many of these alive; and there is an extra level of pointer indirection compared to Rc<str>, which could impact cache locality.