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

Lint request: unnecessary pass-by-reference #1854

Closed
eira-fransham opened this issue Jun 27, 2017 · 1 comment
Closed

Lint request: unnecessary pass-by-reference #1854

eira-fransham opened this issue Jun 27, 2017 · 1 comment
Labels
A-lint Area: New lints L-unnecessary Lint: Warn about unnecessary code

Comments

@eira-fransham
Copy link

eira-fransham commented Jun 27, 2017

It's pretty easy as a newbie to use to_vec on, for example, a boxed slice, when into_vec would be possible. These functions have very similar names and it's not immediately clear which one is correct (especially since the type mismatch compiler hints recommend both). It would be great if there was a lint to recommend into_* conversions when a to_* conversion is used on a type that is not used afterwards. This is based on an issue found in the Parity codebase, where to_vec was being used on boxed slices and causing unnecessary cloning.

@oli-obk oli-obk added L-unnecessary Lint: Warn about unnecessary code A-lint Area: New lints labels Jun 28, 2017
@camsteffen
Copy link
Contributor

Closing in favor of #7908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints L-unnecessary Lint: Warn about unnecessary code
Projects
None yet
Development

No branches or pull requests

3 participants