about summary refs log tree commit diff
path: root/compiler/rustc_parse_format/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-09-18 18:33:37 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2020-09-20 11:42:52 +0200
commitc690c82ad42a15417996a087ef072fd2d8c2fe3a (patch)
treebad049185f6a9362c5b340a24188322d81b09d18 /compiler/rustc_parse_format/src
parent10b3595ba6a4c658c9dea105488fc562c815e434 (diff)
downloadrust-c690c82ad42a15417996a087ef072fd2d8c2fe3a.tar.gz
rust-c690c82ad42a15417996a087ef072fd2d8c2fe3a.zip
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/src')
-rw-r--r--compiler/rustc_parse_format/src/lib.rs9
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 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