simplify parse_format::Parser::ws by using next_if

This commit is contained in:
Marijn Schouten 2025-01-23 09:44:23 +01:00 committed by GitHub
parent cf577f34c4
commit cceb968465
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