You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This already exists in the form of string_to_string.
Hmm, I see. I would be interested in knowing why this lint isn't enabled by default.
(btw "2)", doesn't get picked up by string_to_string in my example)
Uh oh!
There was an error while loading. Please reload this page.
What it does
We should add a lint that causes a warning if the to_string method is used on a String / &String, (not on a &str ofc).
Advantage
The Clone trait is the more commonly used method. Afaik there is no disadvantage of using it instead of ToString.
Drawbacks
None afaik
Example
Could be written as:
The text was updated successfully, but these errors were encountered: