Skip to content

Commit

Permalink
simplify parse_format::Parser::ws by using next_if
Browse files Browse the repository at this point in the history
  • Loading branch information
hkBst authored Jan 23, 2025
1 parent cf577f3 commit cceb968
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions compiler/rustc_parse_format/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cceb968

Please sign in to comment.