From b74ac18e394ffd1043226f88820e7a254c91c9fc Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sat, 10 Aug 2024 18:12:31 +0300 Subject: [PATCH] style: reformat and remove leftover debug print --- src/task.rs | 3 +-- src/tasks.rs | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/task.rs b/src/task.rs index ca33176..ee17711 100644 --- a/src/task.rs +++ b/src/task.rs @@ -134,7 +134,6 @@ impl Task { tags.into_iter() .filter(predicate) .map(|t| format!("{}", t.content().unwrap())) - .collect::>() .join(" ") }) } @@ -160,7 +159,7 @@ impl Task { "hashtags" => self.filter_tags(|tag| { is_hashtag(tag) }), "tags" => self.filter_tags(|_| true), "alltags" => Some(format!("{:?}", self.tags)), - "refs" => Some(format!("{:?}", self.refs.iter().map(|re| format!("{}: {}", re.0, re.1)).collect_vec())), + "refs" => Some(format!("{:?}", self.refs.iter().map(|re| format!("{}: {}", re.0, re.1)).collect_vec())), "props" => Some(format!( "{:?}", self.props diff --git a/src/tasks.rs b/src/tasks.rs index 2fc763c..003fd22 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -68,12 +68,12 @@ impl StateFilter { StateFilter::Default => { let state = task.pure_state(); state.is_open() || (state == State::Done && task.parent_id() != None) - }, + } StateFilter::All => true, StateFilter::State(filter) => task.state().is_some_and(|t| t.matches_label(filter)), } } - + fn as_option(&self) -> Option { if let StateFilter::State(str) = self { Some(str.to_string()) @@ -585,11 +585,11 @@ impl Tasks { } } + /// Creates a task following the current state /// Sanitizes input pub(crate) fn make_task(&mut self, input: &str) -> EventId { let tag: Option = self.get_current_task() .and_then(|t| { - println!("{:?}", t); if t.pure_state() == State::Procedure { t.children.iter() .filter_map(|id| self.get_by_id(id))