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

Give "corrected" code in examples #4829

Closed
ChrisJefferson opened this issue Nov 19, 2019 · 2 comments · Fixed by #4832 or #5664
Closed

Give "corrected" code in examples #4829

ChrisJefferson opened this issue Nov 19, 2019 · 2 comments · Fixed by #4832 or #5664
Labels
A-documentation Area: Adding or improving documentation good-first-issue These issues are a good way to get started with Clippy

Comments

@ChrisJefferson
Copy link

clippy recently pointed me to this: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

This tells me I should make use of "lifetime elision". I can see an example at the bottom, which does indeed show me something which looks like my code, but nothing seems to tell me how to make use of "lifetime elision". Perhaps every example should also come with a "fixed" version, so readers can see the intended outcome of the suggestion?

@flip1995 flip1995 added the A-documentation Area: Adding or improving documentation label Nov 19, 2019
@flip1995
Copy link
Member

I think, that most of the documentation comes with a good and bad example. But old lints (like this one) may only have a bad example, because back then, this was the standard way of writing lint documentation. So we still need to catch up.

@flip1995 flip1995 added the good-first-issue These issues are a good way to get started with Clippy label Nov 19, 2019
@bors bors closed this as completed in 6686892 Nov 28, 2019
@phansch phansch reopened this Nov 28, 2019
@phansch
Copy link
Member

phansch commented Nov 28, 2019

Reopening because there's still other lints without 'fixed' versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Adding or improving documentation good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
3 participants