about summary refs log tree commit diff
path: root/compiler/rustc_parse_format
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-23 19:54:28 +0100
committerGitHub <noreply@github.com>2025-01-23 19:54:28 +0100
commit7d2600698d2acc2b2497dab18433dd6fd5bdd2d6 (patch)
treec23f4e7d28e76a934211e1eb41e892e755512f41 /compiler/rustc_parse_format
parentce2a316c937fa7985c06de6cb69f812740e539bd (diff)
parentcceb968465b41ab7055018b406bffd144eab6433 (diff)
downloadrust-7d2600698d2acc2b2497dab18433dd6fd5bdd2d6.tar.gz
rust-7d2600698d2acc2b2497dab18433dd6fd5bdd2d6.zip
Rollup merge of #135920 - hkBst:patch-16, r=SparrowLii
simplify parse_format::Parser::ws by using next_if
Diffstat (limited to 'compiler/rustc_parse_format')
-rw-r--r--compiler/rustc_parse_format/src/lib.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs
index 9a3e79c16b4..5418f054beb 100644
--- a/compiler/rustc_parse_format/src/lib.rs
+++ b/compiler/rustc_parse_format/src/lib.rs
@@ -514,13 +514,7 @@ impl<'a> Parser<'a> {
 
     /// Consumes all whitespace characters until the first non-whitespace character
     fn ws(&mut self) {
-        while let Some(&(_, c)) = self.cur.peek() {
-            if c.is_whitespace() {
-                self.cur.next();
-            } else {
-                break;
-            }
-        }
+        while let Some(_) = self.cur.next_if(|&(_, c)| c.is_whitespace()) {}
     }
 
     /// Parses all of a string which is to be considered a "raw literal" in a