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

clippy improvements to iterators #28191

Merged
merged 2 commits into from
Sep 4, 2015
Merged

clippy improvements to iterators #28191

merged 2 commits into from
Sep 4, 2015

Conversation

llogiq
Copy link
Contributor

@llogiq llogiq commented Sep 3, 2015

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).

@rust-highfive
Copy link
Collaborator

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.

@llogiq
Copy link
Contributor Author

llogiq commented Sep 3, 2015

r? @Manishearth

@rust-highfive rust-highfive assigned Manishearth and unassigned huonw Sep 3, 2015
@@ -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)
Copy link
Member

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?

@Manishearth
Copy link
Member

r+ if it compiles, else use &mut self.f there

@llogiq
Copy link
Contributor Author

llogiq commented Sep 3, 2015

Strangely it passed a build on my box. @Manishearth you are right, we need &mut self.f.

Edit: Ouch – I built the wrong branch. That's why it worked...

@llogiq
Copy link
Contributor Author

llogiq commented Sep 3, 2015

@Manishearth Does homu need another r+ to run?

@Manishearth
Copy link
Member

@xrpo p}

@Manishearth
Copy link
Member

@bors r+

welp, dvorak

@bors
Copy link
Contributor

bors commented Sep 3, 2015

📌 Commit e1f8919 has been approved by Manishearth

@llogiq
Copy link
Contributor Author

llogiq commented Sep 3, 2015

😄

Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 3, 2015
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).
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 3, 2015
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).
bors added a commit that referenced this pull request Sep 3, 2015
@bors bors merged commit e1f8919 into rust-lang:master Sep 4, 2015
@llogiq llogiq deleted the iter branch September 4, 2015 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants