Skip to content

Commit

Permalink
Rollup merge of rust-lang#135920 - hkBst:patch-16, r=SparrowLii
Browse files Browse the repository at this point in the history
simplify parse_format::Parser::ws by using next_if
  • Loading branch information
matthiaskrgr authored Jan 23, 2025
2 parents ce2a316 + cceb968 commit 7d26006
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 7d26006

Please sign in to comment.