Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to_string is perhaps more idiomatic #788

Closed
hoodie opened this issue Mar 22, 2016 · 2 comments · Fixed by #795
Closed

to_string is perhaps more idiomatic #788

hoodie opened this issue Mar 22, 2016 · 2 comments · Fixed by #795
Labels
good-first-issue These issues are a good way to get started with Clippy S-needs-discussion Status: Needs further discussion before merging or work can be started

Comments

@hoodie
Copy link

hoodie commented Mar 22, 2016

Currently there is https://github.com/Manishearth/rust-clippy/wiki#str_to_string and it tells you that to_string() is slow. Should a lint warn people about this? As soon as specializations lands there will be no difference and you could argue that &str.to_owned() is not idiomatic, so there might be a lint that contradicts an earlier lint.

What do you think?

@mcarton
Copy link
Member

mcarton commented Mar 22, 2016

As soon as specializations lands

Isn’t it the case already? (since a few days, in nightly and modulo an actual specialization of str::to_string 😅 )
We should probably deprecate that lint yes. Ref #728 and #743.

@mcarton mcarton added good-first-issue These issues are a good way to get started with Clippy S-needs-discussion Status: Needs further discussion before merging or work can be started labels Mar 22, 2016
@llogiq
Copy link
Contributor

llogiq commented Mar 23, 2016

Not everyone – even those using clippy – develops against nightly.

Also I don't consider neither .to_string() nor .to_owned() un-idiomatic. Still, I agree we should deprecate that lint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue These issues are a good way to get started with Clippy S-needs-discussion Status: Needs further discussion before merging or work can be started
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants