From b328d9900d0f17c12083911536c3513b177afbc7 Mon Sep 17 00:00:00 2001 From: Denis Evsyukov Date: Mon, 9 Mar 2020 12:49:49 +0300 Subject: [~] write files --- src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index b2816fe..67ae35f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,7 +92,7 @@ Usage: t [-t DIR] [-l LIST] [options] [TEXT]"; let task = matches.opt_str("f").unwrap(); let key = matches.opt_str("f").unwrap(); done.insert(task, tasks.get(&key).unwrap().to_string()); - tasks.remove(&key); + tasks.remove_entry(&key); write = true; } @@ -112,12 +112,10 @@ Usage: t [-t DIR] [-l LIST] [options] [TEXT]"; } return; } - // TODO fix write to file //tasks let mut file = OpenOptions::new() .create(true) .write(true) - .append(true) .open(taskpath.to_str().unwrap()) .unwrap(); @@ -129,7 +127,6 @@ Usage: t [-t DIR] [-l LIST] [options] [TEXT]"; let mut file = OpenOptions::new() .create(true) .write(true) - .append(true) .open(donepath.to_str().unwrap()) .unwrap(); -- cgit v1.2.3