Skip to content

Commit

Permalink
chore(docs): simplify match logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed Feb 20, 2024
1 parent a533045 commit d95849c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions examples/extras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@ fn main() {
let mut lex = Token::lexer(src.as_str());

while let Some(token) = lex.next() {
match token {
Ok(Token::Word((line, column))) => {
println!("Word '{}' found at ({}, {})", lex.slice(), line, column);
}
_ => (),
if let Ok(Token::Word((line, column))) = token {
println!("Word '{}' found at ({}, {})", lex.slice(), line, column);
}
}
}
Expand Down

0 comments on commit d95849c

Please sign in to comment.