I use only .to_owned()
. I believe it is better to stick with a single option everywhere, if there are multiple equivalent choices. Among these choices, String::from
is the most specific, but it's a mouthful to write and prefix, so I stick with .to_owned
as the next one most specific.
As for idiomaticness, I believe there are two "warring camps" of "use .to_string()
because it's simpler to teach", and "use .to_owned()
because it is semantically more frugal"