From 91e3b58f3eb9b5ad78954c0f42812bd5e248340c Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 8 Jul 2016 16:54:27 +0200 Subject: [PATCH] Implement BookmarkCollection::remove_link() --- libimagbookmark/src/collection.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libimagbookmark/src/collection.rs b/libimagbookmark/src/collection.rs index ae9f66e2..b7fc4459 100644 --- a/libimagbookmark/src/collection.rs +++ b/libimagbookmark/src/collection.rs @@ -114,8 +114,14 @@ impl<'a> BookmarkCollection<'a> { }) } - pub fn remove_link(&self, l: Link) -> Result<()> { - unimplemented!() + pub fn remove_link(&mut self, l: Link) -> Result<()> { + use link::IntoUrl; + + l.into_url() + .and_then(|url| { + self.remove_external_link(self.store, url).map_err_into(BEK::LinkingError) + }) + .map_err_into(BEK::LinkError) } }