From 11b0622804a4766d5d173f93862aad751781f579 Mon Sep 17 00:00:00 2001 From: schwente Date: Mon, 6 Jun 2016 14:16:53 +0200 Subject: [PATCH] Fixed the store.delete(...) Return Problem --- libimagtodo/src/delete.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libimagtodo/src/delete.rs b/libimagtodo/src/delete.rs index 79dd8ca5..13d418bf 100644 --- a/libimagtodo/src/delete.rs +++ b/libimagtodo/src/delete.rs @@ -4,16 +4,16 @@ // use std::fs::File; // use std::io::Read; -use std::ops::Deref; -use toml::Value; use uuid::Uuid; use libimagstore::store::Store; use libimagstore::storeid::IntoStoreId; use module_path::ModuleEntryPath; +use error::{TodoError, TodoErrorKind}; + /// With the uuid we get the storeid and than we can delete the entry -fn deleteFunc(uuid: Uuid, store : &Store) { +pub fn deleteFunc(uuid: Uuid, store : &Store) { // With this we can read from a .json File // let mut file = File::open("text.json").unwrap(); // let mut data = String::new(); @@ -25,6 +25,9 @@ fn deleteFunc(uuid: Uuid, store : &Store) { // With the uuid we get the storeid let store_id = ModuleEntryPath::new(format!("taskwarrior/{}", uuid)).into_storeid(); // It deletes an entry - store.delete(store_id); + if let Err(e) = store.delete(store_id) { + return Err(TodoError::new(TodoErrorKind::StoreError, Some(Box::new(e)))).unwrap(); + } + }