-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
clippy improvements to iterators #28191
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @Manishearth |
@@ -1698,7 +1698,7 @@ impl<B, I: DoubleEndedIterator, F> DoubleEndedIterator for Map<I, F> where | |||
{ | |||
#[inline] | |||
fn next_back(&mut self) -> Option<B> { | |||
self.iter.next_back().map(|a| (self.f)(a)) | |||
self.iter.next_back().map(self.f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work? Closures are not Copy
, and you only have mutable access, can't move out of self
- did you mean to write &mut self.f
?
r+ if it compiles, else use |
Strangely it passed a build on my box. @Manishearth you are right, we need Edit: Ouch – I built the wrong branch. That's why it worked... |
@Manishearth Does homu need another r+ to run? |
@xrpo p} |
@bors r+ welp, dvorak |
📌 Commit e1f8919 has been approved by |
😄 |
Nothing too big, a few needless returns and a few closures eliminated (the latter may improve performance in some cases, at least compilation should be a bit faster).
Nothing too big, a few needless returns and a few closures eliminated (the latter may improve performance in some cases, at least compilation should be a bit faster).
Nothing too big, a few needless returns and a few closures eliminated (the latter may improve performance in some cases, at least compilation should be a bit faster).