rust/tests/ui/expr/issue-22933-1.rs
2024-04-21 15:43:43 -03:00

24 lines
392 B
Rust

//@ check-pass
struct CNFParser {
token: char,
}
impl CNFParser {
fn is_whitespace(c: char) -> bool {
c == ' ' || c == '\n'
}
fn consume_whitespace(&mut self) {
self.consume_while(&(CNFParser::is_whitespace))
}
fn consume_while(&mut self, p: &dyn Fn(char) -> bool) {
while p(self.token) {
return
}
}
}
fn main() {}