Skip to content

Commit 7d26006

Browse files
authored
Rollup merge of rust-lang#135920 - hkBst:patch-16, r=SparrowLii
simplify parse_format::Parser::ws by using next_if
2 parents ce2a316 + cceb968 commit 7d26006

File tree

1 file changed

+1
-7
lines changed
  • compiler/rustc_parse_format/src

1 file changed

+1
-7
lines changed

compiler/rustc_parse_format/src/lib.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,7 @@ impl<'a> Parser<'a> {
514514

515515
/// Consumes all whitespace characters until the first non-whitespace character
516516
fn ws(&mut self) {
517-
while let Some(&(_, c)) = self.cur.peek() {
518-
if c.is_whitespace() {
519-
self.cur.next();
520-
} else {
521-
break;
522-
}
523-
}
517+
while let Some(_) = self.cur.next_if(|&(_, c)| c.is_whitespace()) {}
524518
}
525519

526520
/// Parses all of a string which is to be considered a "raw literal" in a

0 commit comments

Comments
 (0)