4 ms·
> Strings are a very common type, and so implement a _lot_ of these things, even when this kind of usecase may overlap. I can't say this is very helpful; it's
by Veedrac 11y ago
> Strings are a very common type, and so implement a _lot_ of these things, even when this kind of usecase may overlap.
I can't say this is very helpful; it's hard enough learning the one way. Why have `to_string()` if we have `into()`?
- steveklabnik 11y agoWell, one reason is that to_string() is ancient, but into() is fairly new. Another is that 'to' and 'into' are two different things: to_string() takes its caller by reference, and produces a copy. into() takes its caller by value, and so consumes it.