Skip to content
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

Merged
merged 3 commits into from
Feb 22, 2017
Merged

some clippy-suggested improvements #3733

merged 3 commits into from
Feb 22, 2017

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
Member

@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.

@@ -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()))?);
Copy link
Member

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.

@@ -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(||{
Copy link
Member

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