From b1a0110a47faf8362ee66513d121e45e1c28957d Mon Sep 17 00:00:00 2001 From: Tamo Date: Thu, 4 Nov 2021 14:48:39 +0100 Subject: [PATCH] update the main --- filter_parser/src/main.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/filter_parser/src/main.rs b/filter_parser/src/main.rs index 4158a2063..a3e4cab28 100644 --- a/filter_parser/src/main.rs +++ b/filter_parser/src/main.rs @@ -1,11 +1,16 @@ fn main() { let input = std::env::args().nth(1).expect("You must provide a filter to test"); - println!("Trying to execute the following filter:\n{}\n\n", input); + println!("Trying to execute the following filter:\n{}\n", input); - if let Err(e) = filter_parser::FilterCondition::parse(&input) { - println!("{}", e.to_string()); - } else { - println!("✅ Valid filter"); + match filter_parser::FilterCondition::parse(&input) { + Ok(filter) => { + println!("✅ Valid filter"); + println!("{:#?}", filter); + } + Err(e) => { + println!("❎ Invalid filter"); + println!("{}", e.to_string()); + } } }