mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
be30c4daf4
ToString is implemented by many different types than &str, and represents a serialization into string data. The fact that said data is returned as owned, is an implementation detail. If merely copying borrowed string data to owned string data is all that is desired, ToOwned is a much better choice, because if the user later refactors the code such that the input is no longer an `&str`, then they will get a compiler error instead of a mysterious change-in-behavior. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |