about summary refs log tree commit diff
path: root/compiler/rustc_parse_format
diff options
context:
space:
mode:
authorMarijn Schouten <hkBst@users.noreply.github.com>2025-01-23 09:44:23 +0100
committerGitHub <noreply@github.com>2025-01-23 09:44:23 +0100
commitcceb968465b41ab7055018b406bffd144eab6433 (patch)
tree6cadc86c542cc51eaf0e01b77d729fe779e3f5be /compiler/rustc_parse_format
parentcf577f34c47937ccb9983186eca5f8719da585f4 (diff)
downloadrust-cceb968465b41ab7055018b406bffd144eab6433.tar.gz
rust-cceb968465b41ab7055018b406bffd144eab6433.zip
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 9eb335cb34c..d88c54417bb 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