Skip to content

Conversation

@llogiq
Copy link
Contributor

@llogiq llogiq commented Feb 18, 2017

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.

@rust-highfive
Copy link

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.

Copy link
Contributor

@killercup killercup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

// 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()))?);
Copy link
Contributor

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(…))

Copy link
Contributor Author

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.

})?;
let refspec = "refs/heads/*:refs/heads/*";
fetch(&repo, &url, refspec, &config).chain_error(||{
fetch(&repo, url, refspec, &config).chain_error(||{
Copy link
Contributor

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 {

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Feb 22, 2017

📌 Commit 1e50878 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Feb 22, 2017

⌛ Testing commit 1e50878 with merge 94f79a8...

@bors
Copy link
Contributor

bors commented Feb 22, 2017

💥 Test timed out

@alexcrichton
Copy link
Member

alexcrichton commented Feb 22, 2017 via email

@bors
Copy link
Contributor

bors commented Feb 22, 2017

⌛ Testing commit 1e50878 with merge e278ea3...

bors added a commit that referenced this pull request Feb 22, 2017
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.
@bors
Copy link
Contributor

bors commented Feb 22, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing e278ea3 to master...

@bors bors merged commit 1e50878 into rust-lang:master Feb 22, 2017
@llogiq llogiq deleted the clippy branch February 22, 2017 17:41
@ehuss ehuss added this to the 1.17.0 milestone Feb 6, 2022
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.

7 participants