From 58162d8d90da00201a1f780aae947ab7b2c4a292 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 15 Jul 2016 15:34:41 +0200 Subject: [PATCH] Impl Task::get_from_uuid() --- libimagtodo/src/task.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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>> { - 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