diff options
author | ecstatic-morse <ecstaticmorse@gmail.com> | 2020-09-21 20:40:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 20:40:55 -0700 |
commit | dcf4d1f2beefa7bebdbfb31e4774cefa901928b7 (patch) | |
tree | 4432dd5d81aa59585c17d4585facccd99335d15b /compiler/rustc_parse_format | |
parent | 60b99015e95e5840a8f409d1042f1e3458d2c7dd (diff) | |
parent | c690c82ad42a15417996a087ef072fd2d8c2fe3a (diff) | |
download | rust-dcf4d1f2beefa7bebdbfb31e4774cefa901928b7.tar.gz |
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)
Diffstat (limited to 'compiler/rustc_parse_format')
-rw-r--r-- | compiler/rustc_parse_format/src/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index dde162681b7..cef632b1d8f 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -525,12 +525,9 @@ impl<'a> Parser<'a> { // fill character if let Some(&(_, c)) = self.cur.peek() { - match self.cur.clone().nth(1) { - Some((_, '>' | '<' | '^')) => { - spec.fill = Some(c); - self.cur.next(); - } - _ => {} + if let Some((_, '>' | '<' | '^')) = self.cur.clone().nth(1) { + spec.fill = Some(c); + self.cur.next(); } } // Alignment |