Skip to content

Commit cceb968

Browse files
authored
simplify parse_format::Parser::ws by using next_if
1 parent cf577f3 commit cceb968

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)