-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Clean up code mostly based on clippy suggestions #7911
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. Due to 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. |
☔ The latest upstream changes (presumably #7820) made this pull request unmergeable. Please resolve the merge conflicts. |
crates/cargo-platform/src/lib.rs
Outdated
https://doc.rust-lang.org/cargo/reference/features.html" | ||
)), | ||
_ => (), | ||
Cfg::KeyPair(name, _) => if let "feature" = name.as_str() { |
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.
Could this be if name.as_str() == "feature"
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.
It can indeed, changed!
@@ -208,7 +208,7 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoRes | |||
|
|||
// Be sure to pass along all enabled features for this package, this is the | |||
// last piece of statically known information that we have. | |||
for feat in &unit.features { | |||
for &feat in &unit.features { |
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.
Can you explain these changes to add &
? It looks more confusing to me.
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.
The IDE suggested that there's double reference in one of those variables (like &&str), so adding & helps avoiding it. Then I looked for similar patterns and changed them as well.
On the second thought it's not very important, so I have removed that commit.
0c035c3
to
511a704
Compare
crates/cargo-platform/src/lib.rs
Outdated
https://doc.rust-lang.org/cargo/reference/features.html" | ||
)), | ||
_ => (), | ||
Cfg::KeyPair(name, _) => if name.as_str() == "feature"{ |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Hm, I wonder why doesn't rustfmt catch this. Thank you, I've added the missing space.
511a704
to
2b1dc3e
Compare
Thanks! |
📌 Commit 2b1dc3e has been approved by |
⌛ Testing commit 2b1dc3e with merge d21ef5d05a010f55cf6ecaad455168cb4bee6736... |
💔 Test failed - checks-azure |
@bors retry |
☀️ Test successful - checks-azure |
Update cargo 11 commits in e02974078a692d7484f510eaec0e88d1b6cc0203..e57bd02999c9f40d52116e0beca7d1dccb0643de 2020-02-18 15:24:43 +0000 to 2020-02-21 20:20:10 +0000 - fix most remaining clippy findings (mostly redundant imports) (rust-lang/cargo#7912) - Add -Zfeatures tracking issues. (rust-lang/cargo#7917) - Use rust-lang/rust linkchecker on CI. (rust-lang/cargo#7913) - Clean up code mostly based on clippy suggestions (rust-lang/cargo#7911) - Add an option to include crate versions to the generated docs (rust-lang/cargo#7903) - Better support for license-file. (rust-lang/cargo#7905) - Add new feature resolver. (rust-lang/cargo#7820) - Switch azure to macOS 10.15. (rust-lang/cargo#7906) - Modified the help information of cargo-rustc (rust-lang/cargo#7892) - Update for nightly rustfmt. (rust-lang/cargo#7904) - Support `--config path_to_config.toml` cli syntax. (rust-lang/cargo#7901)
No description provided.