Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPC

use if let instead of single match arm expressions

use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
This commit is contained in:
ecstatic-morse 2020-09-21 20:40:55 -07:00 committed by GitHub
commit dcf4d1f2be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 58 deletions

View file

@ -149,12 +149,9 @@ impl<'a> TokenTreesReader<'a> {
}
}
match (open_brace, delim) {
//only add braces
(DelimToken::Brace, DelimToken::Brace) => {
self.matching_block_spans.push((open_brace_span, close_brace_span));
}
_ => {}
//only add braces
if let (DelimToken::Brace, DelimToken::Brace) = (open_brace, delim) {
self.matching_block_spans.push((open_brace_span, close_brace_span));
}
if self.open_braces.is_empty() {