-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Remove pointless calls to *iter() and iter_mut() #26190
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (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. |
🎊 |
@@ -73,7 +73,7 @@ r##"<!DOCTYPE html> | |||
|
|||
try!(write!(&mut output_file, "<h1>Rust Compiler Error Index</h1>\n")); | |||
|
|||
for (err_code, info) in err_map.iter() { | |||
for (err_code, info) in err_map { |
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.
This kind of thing is extra interesting, because this looks like a change in semantics, but since err_map
is a reference, it's not.
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.
IMHO, this isn't particularly worrisome because the default - move if it's a value or take references if it's a reference - is always either the right thing or a compiler error. YMMV.
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.
Yeah, I don't think it's a problem at all, just an interesting side-effect of looking at the diff.
Thanks for the PR @Veedrac! I personally wouldn't so aggressively remove calls to iterators, as sometimes it's more clear (for example where the replacement uses In general I personally prefer |
There are a few cases here
Can I get a definitive statement of which of these should be removed? It's not much hassle, but I'd nevertheless like to do it only once. :) |
I would go for |
Same. |
Reborrows actually seemed to be more common than calling FWIW, I've included reborrows of the form |
I just stumbled on #21830, which changed several |
This passed all builds except one mac build which failed b/c the bot disappeared, so merging manually. |
Pull request for #26188.