Thankfully no one writes that today because String::from is objectively superior
-
-
I use str.to_owned() and I can confirm it's superiority.
Right after I started using Rust and got used to that method someone made it so that to_string, to_owned, etc. are equivalent so I guess it really doesn't matter. lol -
I'm firmly in the `String::from` camp. I know that `String` is heap allocated, and I know that I'm getting `String` as a result. `.to_owned` tells me neither of those things.
- 9 more replies
New conversation -
-
-
I'm in the "I was around before 1.0 where we changed the name of String twice and fucked with to_owned a million times and had to refactor from to_owned to to_string back to to_owned and now I hate ownerifying strings in any way period strings can go die in a fire" camp
-
*Flashbacks to when to_owned was faster than to_string causing confusion for many people*
- 3 more replies
New conversation -
-
-
Noo! "String".into()

-
"For when you want newbies to have no idea what you're actually doing, `Into::into`"
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.