Skip to content

Utilize Option::cloned over explicit clone usage. #32238

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

Merged
merged 1 commit into from
Mar 15, 2016

Conversation

frewsxcv
Copy link
Member

No description provided.

@rust-highfive
Copy link
Contributor

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.

@alexcrichton
Copy link
Member

@bors: r+ 8842e398b0a0f3ae1ada682c3cef358fb98e7f22

None => None,
Some(ref filter) => Some(filter.clone()),
},
filter: config.filter.as_ref().cloned(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just config.filter.clone()?

@frewsxcv
Copy link
Member Author

Why not just config.filter.clone()?

Thanks for pointing this out. I didn't know that calling clone on an &Option would result in the inner data getting cloned as well.

Force pushed the commit with that change and also updated .get(0) to .first().

@alexcrichton
Copy link
Member

@bors: r+ 8f008ba

@bors
Copy link
Collaborator

bors commented Mar 15, 2016

⌛ Testing commit 8f008ba with merge 4db8b5b...

bors added a commit that referenced this pull request Mar 15, 2016
Utilize `Option::cloned` over explicit `clone` usage.
@bors bors merged commit 8f008ba into rust-lang:master Mar 15, 2016
@frewsxcv frewsxcv deleted the compiletest branch October 2, 2016 23:07
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.

6 participants