From 2ed07d4f7d088a2de7927971880503f931ca0cf8 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 8 Jul 2016 16:30:11 +0200 Subject: [PATCH] Impl BookmarkCollection::add_link() --- libimagbookmark/src/collection.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libimagbookmark/src/collection.rs b/libimagbookmark/src/collection.rs index a6e29ee0..2a820c29 100644 --- a/libimagbookmark/src/collection.rs +++ b/libimagbookmark/src/collection.rs @@ -95,8 +95,12 @@ impl<'a> BookmarkCollection<'a> { .map_err_into(BEK::StoreReadError) } - pub fn add_link(&self, l: Link) -> Result<()> { - unimplemented!() + pub fn add_link(&mut self, l: Link) -> Result<()> { + use link::IntoUrl; + + l.into_url() + .and_then(|url| self.add_external_link(self.store, url).map_err_into(BEK::LinkingError)) + .map_err_into(BEK::LinkError) } pub fn get_link(&self, l: Link) -> Result {