diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-07-08 16:30:11 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-07-08 16:30:11 +0200 |
commit | 2ed07d4f7d088a2de7927971880503f931ca0cf8 (patch) | |
tree | d8849fb1806bfc74b999ba3adfff153c750585c1 /libimagbookmark | |
parent | db21fa9dd4c3d30888da501e2919fe900eb4c733 (diff) |
Impl BookmarkCollection::add_link()
Diffstat (limited to 'libimagbookmark')
-rw-r--r-- | libimagbookmark/src/collection.rs | 8 |
1 files 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<Link> { |