Looks like most (all?) conversions create a new String, which means it should be sufficient for them to accept &str and not a String.
This way it would be possible to convert borrowed strings without cloning them (which is expensive due to extra temporary heap allocation and copying data).
Looks like most (all?) conversions create a new String, which means it should be sufficient for them to accept
&str
and not aString
.This way it would be possible to convert borrowed strings without cloning them (which is expensive due to extra temporary heap allocation and copying data).