1
Fork 0

Rollup merge of #135920 - hkBst:patch-16, r=SparrowLii

simplify parse_format::Parser::ws by using next_if
This commit is contained in:
Matthias Krüger 2025-01-23 19:54:28 +01:00 committed by GitHub
commit 7d2600698d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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