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:
commit
dcf4d1f2be
8 changed files with 28 additions and 58 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue