Skip to content

Commit

Permalink
fixed a bug of moving dup sub-tasks and make unit test all pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jfding committed Oct 6, 2024
1 parent ca1367b commit 10497eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/taskbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ impl TaskBox {

if ! from._mark_task_with_done_subtask(task) {
// remove the one from "from"
from.tasks.retain(|(t, _)| t != task)
#[allow(clippy::nonminimal_bool)]
from.tasks.retain(|(t, d)| ! (t == task && !d));
}
}

Expand Down Expand Up @@ -496,7 +497,8 @@ impl TaskBox {
self._dump();
}
if ! newr.is_empty() {
let mut rbox = TaskBox::new(util::get_inbox_file("routine"));
// cannot use util:get_inbox_file(), not thread safe
let mut rbox = TaskBox::new(self.fpath.parent().unwrap().join(ROUTINE_BOXNAME).with_extension("md"));
rbox.load();
newr.iter().for_each(|t| rbox._addone(t.to_string()));
rbox._dump();
Expand Down

0 comments on commit 10497eb

Please sign in to comment.