fix match_time value update

This commit is contained in:
yggverse 2025-06-09 12:39:31 +03:00
parent 3e520aa1ea
commit 120f8811c2

View file

@ -15,10 +15,6 @@ fn main() -> anyhow::Result<()> {
argument::Argument::parse() argument::Argument::parse()
}; };
let match_time = argument
.match_time
.map(|ref t| chrono::Local::now().format(t).to_string());
// parse some arguments once // parse some arguments once
let is_debug_i = argument.debug.contains("i"); let is_debug_i = argument.debug.contains("i");
let is_debug_d = argument.debug.contains("d"); 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() { 'l: for line in BufReader::new(File::open(&argument.source)?).lines() {
let l = line?; let l = line?;
if let Some(ref t) = match_time { if let Some(ref t) = argument.match_time {
if !l.contains(t) { if !l.contains(&chrono::Local::now().format(t).to_string()) {
if is_debug_d { if is_debug_d {
debug::info(&format!("Record time mismatch time filter {t}")) debug::info(&format!("Record time mismatch time filter {t}"))
} }