From d95849c3e783e0598b5caf947bdc43f7ea8b3564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Tue, 20 Feb 2024 09:44:42 +0100 Subject: [PATCH] chore(docs): simplify match logic --- examples/extras.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/extras.rs b/examples/extras.rs index 4e89c2e3..eb1bdb9a 100644 --- a/examples/extras.rs +++ b/examples/extras.rs @@ -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); } } }