From 7ac98e1e5442986fa8644535c68ae4b3b8d3cab4 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 25 Aug 2016 19:30:05 +0200 Subject: [PATCH] Fix libimagbookmark::collection::* for new StoreId interface --- libimagbookmark/src/collection.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libimagbookmark/src/collection.rs b/libimagbookmark/src/collection.rs index b7fc4459..b2cde9ef 100644 --- a/libimagbookmark/src/collection.rs +++ b/libimagbookmark/src/collection.rs @@ -51,8 +51,9 @@ impl<'a> DerefMut for BookmarkCollection<'a> { impl<'a> BookmarkCollection<'a> { pub fn new(store: &'a Store, name: &str) -> Result> { - let id = ModuleEntryPath::new(name).into_storeid(); - store.create(id) + ModuleEntryPath::new(name) + .into_storeid() + .and_then(|id| store.create(id)) .map(|fle| { BookmarkCollection { fle: fle, @@ -63,8 +64,9 @@ impl<'a> BookmarkCollection<'a> { } pub fn get(store: &'a Store, name: &str) -> Result> { - let id = ModuleEntryPath::new(name).into_storeid(); - store.get(id) + ModuleEntryPath::new(name) + .into_storeid() + .and_then(|id| store.get(id)) .map_err_into(BEK::StoreReadError) .and_then(|fle| { match fle { @@ -78,7 +80,10 @@ impl<'a> BookmarkCollection<'a> { } pub fn delete(store: &Store, name: &str) -> Result<()> { - store.delete(ModuleEntryPath::new(name).into_storeid()).map_err_into(BEK::StoreReadError) + ModuleEntryPath::new(name) + .into_storeid() + .and_then(|id| store.delete(id)) + .map_err_into(BEK::StoreReadError) } pub fn links(&self) -> Result> {