about summary refs log tree commit diff
path: root/compiler/rustc_parse_format/src
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2025-01-24 05:28:23 +0000
committerGitHub <noreply@github.com>2025-01-24 05:28:23 +0000
commitf8f5c9d64297f34a260abd882f752153e85102f3 (patch)
tree6100914717d811f3627524c0f79d4b4e8814613b /compiler/rustc_parse_format/src
parente923d85be4a6ea0e4a1668ed01b27dabbbe76d68 (diff)
parentd22ba488f066532993592e01417f2612c3dbf3b3 (diff)
downloadrust-f8f5c9d64297f34a260abd882f752153e85102f3.tar.gz
rust-f8f5c9d64297f34a260abd882f752153e85102f3.zip
Merge pull request #4147 from rust-lang/rustup-2025-01-24
Automatic Rustup
Diffstat (limited to 'compiler/rustc_parse_format/src')
-rw-r--r--compiler/rustc_parse_format/src/lib.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs
index 9eb335cb34c..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
@@ -545,7 +539,7 @@ impl<'a> Parser<'a> {
                 }
             }
         }
-        &self.input[start..self.input.len()]
+        &self.input[start..]
     }
 
     /// Parses an `Argument` structure, or what's contained within braces inside the format string.