diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-07-15 15:34:41 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-07-21 17:14:12 +0200 |
commit | 58162d8d90da00201a1f780aae947ab7b2c4a292 (patch) | |
tree | 366d0783ee36d5da3264c32eefaa8ffc42c96a45 /libimagtodo | |
parent | 302b46be5f7ccd9a05d5d3df06372554b7548ef9 (diff) |
Impl Task::get_from_uuid()
Diffstat (limited to 'libimagtodo')
-rw-r--r-- | libimagtodo/src/task.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libimagtodo/src/task.rs b/libimagtodo/src/task.rs index 3459bdfc..127deae9 100644 --- a/libimagtodo/src/task.rs +++ b/libimagtodo/src/task.rs @@ -73,7 +73,11 @@ impl<'a> Task<'a> { /// /// If there is no task with this UUID, this returns `Ok(None)`. pub fn get_from_uuid(store: &'a Store, uuid: Uuid) -> Result<Option<Task<'a>>> { - unimplemented!() + let store_id = ModuleEntryPath::new(format!("taskwarrior/{}", uuid)).into_storeid(); + + store.get(store_id) + .map(|o| o.map(Task::new)) + .map_err_into(TodoErrorKind::StoreError) } /// Same as Task::get_from_import() but uses Store::retrieve() rather than Store::get(), to |