aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Evsyukov <[email protected]>2020-03-09 10:05:48 +0300
committerDenis Evsyukov <[email protected]>2020-03-09 10:05:48 +0300
commita7778e34ab4eef5ca774efbc58e00fa7a00a2e77 (patch)
treed415f264d31d56cf67a88c0fd581328fa4351592
parent[~] read files (diff)
downloadt-a7778e34ab4eef5ca774efbc58e00fa7a00a2e77.tar.xz
t-a7778e34ab4eef5ca774efbc58e00fa7a00a2e77.zip
[~] simpify donefile
-rw-r--r--src/main.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/main.rs b/src/main.rs
index 72f81de..806d303 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -51,6 +51,7 @@ Usage: t [-t DIR] [-l LIST] [options] [TEXT]";
let path = env::current_dir().unwrap();
let taskfile = matches.opt_str("l").unwrap_or_else(|| "tasks".to_string());
+ let donefile = format!(".{}.done", taskfile);
let taskdir = matches
.opt_str("t")
.unwrap_or_else(|| path.to_str().unwrap().to_string());
@@ -61,16 +62,6 @@ Usage: t [-t DIR] [-l LIST] [options] [TEXT]";
println!("taskdir: {}", taskpath.to_str().unwrap().to_string());
// read files
- let donefile = format!(
- ".{}.done",
- taskpath
- .as_path()
- .file_name()
- .unwrap()
- .to_os_string()
- .into_string()
- .unwrap()
- );
let mut donepath = PathBuf::from(taskpath.as_path().parent().unwrap().to_path_buf());
donepath.push(donefile);