We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 .next_back() insteaad of .rev().next() when that's equivalent.
.next_back()
.rev().next()
iter_rev_next
pedantic
People will point it out at code review anyway. Might as well spare them some typing
I haven't thought about edge cases where applying the suggestion would not be correct
foo.iter().rev().next()
Could be written as:
foo.iter().next_back()
The text was updated successfully, but these errors were encountered:
This is applicable when the type of foo.iter() is DoubleEndedIterator: both rev and next_back requires it as a bound.
foo.iter()
DoubleEndedIterator
rev
next_back
Sorry, something went wrong.
manual_next_back
3d456ce
Successfully merging a pull request may close this issue.
What it does
Suggest
.next_back()
insteaad of.rev().next()
when that's equivalent.Lint Name
iter_rev_next
Category
pedantic
Advantage
People will point it out at code review anyway. Might as well spare them some typing
Drawbacks
I haven't thought about edge cases where applying the suggestion would not be correct
Example
Could be written as:
The text was updated successfully, but these errors were encountered: