aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Evsyukov <[email protected]>2020-03-09 12:49:49 +0300
committerDenis Evsyukov <[email protected]>2020-03-09 12:49:49 +0300
commitb328d9900d0f17c12083911536c3513b177afbc7 (patch)
treee7a1bebd0369f5433149fc2e5d7a4f42894084dd
parent[~] write to files (diff)
downloadt-b328d9900d0f17c12083911536c3513b177afbc7.tar.xz
t-b328d9900d0f17c12083911536c3513b177afbc7.zip
[~] write files
-rw-r--r--src/main.rs5
1 files changed, 1 insertions, 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();