diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-06-17 17:20:54 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2017-06-26 17:32:41 +0200 |
commit | 61616673cba7a14bc6fb92f3dbe2ea9d30929a80 (patch) | |
tree | c3a0783abc790cabafabf4970d6693949f625c0b | |
parent | af2769df5b6fb6f9d7ad3be429fea50ec427e856 (diff) |
Redo path altering
-rw-r--r-- | libimagtimetrack/src/eventstore.rs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/libimagtimetrack/src/eventstore.rs b/libimagtimetrack/src/eventstore.rs index fe642d86..1ce5d55b 100644 --- a/libimagtimetrack/src/eventstore.rs +++ b/libimagtimetrack/src/eventstore.rs @@ -69,9 +69,14 @@ impl<'a> TimeTrackStore<'a> for Store { } fn create_timetracking_at(&'a self, start: &NDT, ts: &TTT) -> Result<FileLockEntry<'a>> { + use std::path::PathBuf; + COMPILER.compile(CRATE_NAME, start) .map_err_into(TTEK::StoreIdError) - .and_then(|id| enhance_id_with_tag(id, ts)) + .map(|mut id| { + id.local_push(PathBuf::from(ts.as_str())); + id + }) .and_then(|id| self.create(id).map_err_into(TTEK::StoreWriteError)) .and_then(|mut fle| { let v = Value::String(ts.as_str().to_owned()); @@ -108,13 +113,3 @@ impl<'a> TimeTrackStore<'a> for Store { } -/// TODO: We need a new function on StoreId to do this in a nice way: -/// -/// `storeid.append_to_filename(string)` -/// -fn enhance_id_with_tag(s: StoreId, t: &TTT) -> Result<StoreId> { - let mut new = s.local().clone(); - new.push(t.as_str().to_owned()); - StoreId::new_baseless(new).map_err_into(TTEK::StoreIdError) -} - |