From c690c82ad42a15417996a087ef072fd2d8c2fe3a Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Fri, 18 Sep 2020 18:33:37 +0200 Subject: use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match) --- compiler/rustc_parse_format/src/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'compiler/rustc_parse_format/src') diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index e07b8b86aef..556bf69c931 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -527,12 +527,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 -- cgit 1.4.1-3-g733a5