Into<String> is super handy for passing in either a
&str or a
String to a function that ultimately wants an owned
String, and I expected this to be generalized to all types that implement
Clone, so that I can write functions that can take either moved values or a reference to a value with a clone. It seems that there is no
From<&T> for T where T: Clone implementation though - why? Is there some underlying reason why this wasn’t implemented, or is it an oversight?
There is an implementation of
ToOwned<T> for T where T: Clone, but obviously that wouldn’t work for moving values.