From 120f8811c22bed83410407ad5f2f531d25fbc785 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 9 Jun 2025 12:39:31 +0300 Subject: [PATCH] fix `match_time` value update --- src/main.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index ae6832d..c117f8b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,10 +15,6 @@ fn main() -> anyhow::Result<()> { argument::Argument::parse() }; - let match_time = argument - .match_time - .map(|ref t| chrono::Local::now().format(t).to_string()); - // parse some arguments once let is_debug_i = argument.debug.contains("i"); let is_debug_d = argument.debug.contains("d"); @@ -41,8 +37,8 @@ fn main() -> anyhow::Result<()> { 'l: for line in BufReader::new(File::open(&argument.source)?).lines() { let l = line?; - if let Some(ref t) = match_time { - if !l.contains(t) { + if let Some(ref t) = argument.match_time { + if !l.contains(&chrono::Local::now().format(t).to_string()) { if is_debug_d { debug::info(&format!("Record time mismatch time filter {t}")) }