use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)

This commit is contained in:
Matthias Krüger 2020-09-18 18:33:37 +02:00
parent 10b3595ba6
commit c690c82ad4
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() {