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

Suggest .get() over .iter().nth() #1009

Closed
mcarton opened this issue Jun 12, 2016 · 3 comments
Closed

Suggest .get() over .iter().nth() #1009

mcarton opened this issue Jun 12, 2016 · 3 comments
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-perf Lint: Belongs in the perf lint group L-style Lint: Belongs in the style lint group T-middle Type: Probably requires verifiying types

Comments

@mcarton
Copy link
Member

mcarton commented Jun 12, 2016

.get() exists on slices, which people (including me) seem not to be aware of (cc #1008).

@mcarton mcarton added good-first-issue These issues are a good way to get started with Clippy T-middle Type: Probably requires verifiying types A-lint Area: New lints L-style Lint: Belongs in the style lint group L-perf Lint: Belongs in the perf lint group labels Jun 12, 2016
@devonhollowood
Copy link
Contributor

I can do this one, if that's okay.

@mcarton
Copy link
Member Author

mcarton commented Jun 16, 2016

@devonhollowood great!
Don't hesitate to ask if you have any question.

@devonhollowood
Copy link
Contributor

I went ahead and implemented the same check for Vecs. I hope that was okay. Pull request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-perf Lint: Belongs in the perf lint group L-style Lint: Belongs in the style lint group T-middle Type: Probably requires verifiying types
Projects
None yet
Development

No branches or pull requests

2 participants