From f5aca3eca87fdbcf875868025ddd725484772806 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Wed, 14 Aug 2024 15:36:54 +0300 Subject: [PATCH] fix(main): better feedback after adjusting timetracking --- src/main.rs | 17 +++++++---------- src/tasks.rs | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4737786..c586f5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -470,19 +470,16 @@ async fn main() { None => tasks.clear_filter() } - Some('(') => - match arg { - Some(arg) => - if !tasks.track_from(arg) { - continue; - } - None => { - println!("{}", tasks.times_tracked()); + Some('(') => { + if let Some(arg) = arg { + if !tasks.track_from(arg) { continue; } - } - + println!("{}", tasks.times_tracked()); + continue; + } + Some(')') => { tasks.move_to(None); if let Some(arg) = arg { diff --git a/src/tasks.rs b/src/tasks.rs index 4b63638..719aba0 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -698,7 +698,7 @@ impl Tasks { } else if let Ok(date) = DateTime::parse_from_rfc3339(str) { self.track_at(Timestamp::from(date.to_utc().timestamp() as u64)); } else { - warn!("Cannot parse {str}"); + warn!("Cannot parse time from {str}"); return false; } true