-
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
some clippy-suggested improvements #3733
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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. |
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.
Nice.
@@ -76,7 +76,7 @@ impl Layout { | |||
// the target triple as a Path and then just use the file stem as the | |||
// component for the directory name. | |||
if let Some(triple) = triple { | |||
path.push(Path::new(triple).file_stem().ok_or(human(format!("target was empty")))?); | |||
path.push(Path::new(triple).file_stem().ok_or(human("target was empty".to_string()))?); |
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.
I'm surprised clippy didn't suggest ok_or_else(|| human(…))
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 did, but I didn't fix all of those.
src/cargo/sources/git/utils.rs
Outdated
@@ -610,7 +610,7 @@ pub fn clone(url: &str, target: &Path, config: &Config) -> CargoResult<()> { | |||
target.display())) | |||
})?; | |||
let refspec = "refs/heads/*:refs/heads/*"; | |||
fetch(&repo, &url, refspec, &config).chain_error(||{ | |||
fetch(&repo, url, refspec, &config).chain_error(||{ |
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.
bonus points: add blank before {
@bors: r+ Thanks! |
📌 Commit 1e50878 has been approved by |
⌛ Testing commit 1e50878 with merge 94f79a8... |
💥 Test timed out |
@bors: retry
…On Wed, Feb 22, 2017 at 8:59 AM, bors ***@***.***> wrote:
💥 Test timed out
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3733 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95B7jqaFhBSuG7SgiJs0ZPcZsCgElks5rfE1ugaJpZM4MFHym>
.
|
some clippy-suggested improvements This fixes a number of [clippy](https://github.com/Manishearth/rust-clippy) warnings. It's mostly about readability, though a few changes could affect performance (though probably not measurably). I've left out things to fix later; I thought I'd just push the first batch to see if you like it.
☀️ Test successful - status-appveyor, status-travis |
This fixes a number of clippy warnings. It's mostly about readability, though a few changes could affect performance (though probably not measurably).
I've left out things to fix later; I thought I'd just push the first batch to see if you like it.