Skip to content

Conversation

@tnielens
Copy link
Contributor

@tnielens tnielens commented Jul 6, 2020

One approach to fix #3489.
See discussion in the issue.

changelog: single_match_else - single expr/stmt else block corner case fix

@rust-highfive
Copy link

r? @matthiaskrgr

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 6, 2020
Comment on lines 42 to 55
// don't lint here
match Some(1) {
Some(a) => println!("${:?}", a),
None => return,
}

// don't lint here
match Some(1) {
Some(a) => println!("${:?}", a),
None => return,
}
Copy link
Member

Choose a reason for hiding this comment

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

is this supposed to be the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah my bad, this is supposed to be the {return} case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know now, forgot to skip rustfmt on those cases.

@tnielens tnielens force-pushed the bugfix/single-match-else branch from 1ed3582 to c8c286c Compare July 7, 2020 20:39
@matthiaskrgr
Copy link
Member

Thanks, can you please run rustfmt? I see some trailing whitespaces.

@tnielens tnielens force-pushed the bugfix/single-match-else branch from c8c286c to dac19e3 Compare July 9, 2020 10:04
@tnielens
Copy link
Contributor Author

tnielens commented Jul 9, 2020

Thanks, can you please run rustfmt? I see some trailing whitespaces.

cargo dev fmt did modify anything. I spotted two trailing spaces on comments which I removed.

@matthiaskrgr
Copy link
Member

cargo dev fmt did modify anything.

That's strange.
In theory cargo fmt --all should also work in most cases (but it will skip tests I think).

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jul 9, 2020

📌 Commit dac19e3 has been approved by matthiaskrgr

@bors
Copy link
Contributor

bors commented Jul 9, 2020

⌛ Testing commit dac19e3 with merge 45eea9a...

@bors
Copy link
Contributor

bors commented Jul 9, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: matthiaskrgr
Pushing 45eea9a to master...

@bors bors merged commit 45eea9a into rust-lang:master Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FN single_match_else

4 participants