-
Notifications
You must be signed in to change notification settings - Fork 13.3k
cleanup: use the for x in &xs
form instead of for x in xs.iter()
#21830
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
Conversation
for x &xs
form instead of for x in xs.iter()
for x in &xs
form instead of for x in xs.iter()
Nice! |
@bors: try 8faaedb |
⌛ Testing commit 8faaedb with merge f72a395... |
😻 Glad to see those |
💔 Test failed - auto-mac-64-opt |
@bors: try f78904c |
⌛ Testing commit f78904c with merge f5730a2... |
💔 Test failed - auto-win-64-nopt-t |
@bors: try baa4ac1 |
⌛ Testing commit baa4ac1 with merge 3a566cd... |
💔 Test failed - auto-mac-64-opt |
@bors: try 6193055 |
⌛ Testing commit 6193055 with merge f1be0a3... |
Ok, this should be ready to go now. And sorry for hogging the |
Great work as always, @japaric! |
@bors: r=alexcrichton |
🙀 You have the wrong number! Please try again with |
@bors: r=alexcrichton 5e7ebb1 |
🙀 You have the wrong number! Please try again with |
Huh, there's some discrepancy with the last commit in order and the one bors seems to want. @japaric, any idea what's going on there? |
Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`
Also `for x in option.into_iter()` -> `if let Some(x) = option`
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
Massive patch. |
This also implements
IntoIterator
forHashMap
s andHashSet
s, and changes the conditionalsfor x in option.iter()
statements to the more readable form:if let Some(x) = option
. (The former looks like an ordinary for-loop, the later clearly states conditional execution).r? @alexcrichton
This needs a snapshot before it can land.