Skip to content

Replace some verbose match statements with their if let equivalent. #19405

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 2 commits into from
Dec 2, 2014

Conversation

jfager
Copy link
Contributor

@jfager jfager commented Nov 29, 2014

No semantic changes, no enabling if let where it wasn't already enabled.

No semantic changes, no enabling `if let` where it wasn't already enabled.
@rust-highfive
Copy link
Contributor

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@bstrie
Copy link
Contributor

bstrie commented Nov 30, 2014

This PR is probably the best argument I've ever seen for if-let.

@justanotheranonymoususer

−1,337 lines, nice!

cdata);
if let Some(impl_method_doc) = maybe_find_item(impl_item_def_id.node, items) {
match item_family(impl_method_doc) {
StaticMethod => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you also use if let here?

if let StaticMethod = item_family(impl_method_doc) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, plus a few other little spots I missed. Thanks!

bors added a commit that referenced this pull request Dec 1, 2014
No semantic changes, no enabling `if let` where it wasn't already enabled.
@bors bors closed this Dec 2, 2014
@bors bors merged commit a779e3b into rust-lang:master Dec 2, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 28, 2025
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