From 8a5bc09b62ed7a91e5a60e12fa68cba92395d2c8 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 30 May 2019 10:30:24 +0200 Subject: [PATCH] Fix libimagbookmark for new url library --- lib/domain/libimagbookmark/Cargo.toml | 1 + lib/domain/libimagbookmark/src/collection.rs | 12 ++++++------ lib/domain/libimagbookmark/src/lib.rs | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/domain/libimagbookmark/Cargo.toml b/lib/domain/libimagbookmark/Cargo.toml index cd2aaa9e..f351fa5c 100644 --- a/lib/domain/libimagbookmark/Cargo.toml +++ b/lib/domain/libimagbookmark/Cargo.toml @@ -27,4 +27,5 @@ failure = "0.1" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } libimagerror = { version = "0.10.0", path = "../../../lib/core/libimagerror" } libimagentrylink = { version = "0.10.0", path = "../../../lib/entry/libimagentrylink" } +libimagentryurl = { version = "0.10.0", path = "../../../lib/entry/libimagentryurl" } diff --git a/lib/domain/libimagbookmark/src/collection.rs b/lib/domain/libimagbookmark/src/collection.rs index 65890483..6647a261 100644 --- a/lib/domain/libimagbookmark/src/collection.rs +++ b/lib/domain/libimagbookmark/src/collection.rs @@ -35,7 +35,7 @@ use libimagstore::store::Entry; use libimagstore::store::FileLockEntry; use libimagstore::storeid::StoreId; use libimagentryurl::linker::UrlLinker; -use libimagentrylink::external::iter::UrlIter; +use libimagentryurl::iter::UrlIter; use libimagentrylink::internal::InternalLinker; use libimagentrylink::internal::Link as StoreLink; @@ -80,7 +80,7 @@ impl<'a> BookmarkCollectionStore<'a> for Store { } -pub trait BookmarkCollection : Sized + InternalLinker + ExternalLinker { +pub trait BookmarkCollection : Sized + InternalLinker + UrlLinker { fn links<'a>(&self, store: &'a Store) -> Result>; fn link_entries(&self) -> Result>; fn add_link(&mut self, store: &Store, l: Link) -> Result>; @@ -95,7 +95,7 @@ impl BookmarkCollection for Entry { } fn link_entries(&self) -> Result> { - use libimagentrylink::external::is_external_link_storeid; + use libimagentryurl::util::is_external_link_storeid; self.get_internal_links().map(|v| v.filter(|id| is_external_link_storeid(id)).collect()) } @@ -120,6 +120,9 @@ pub mod iter { use crate::link::Link; use failure::Fallible as Result; use failure::Error; + use regex::Regex; + + use libimagentryurl::iter::UrlIter; pub struct LinkIter(I) where I: Iterator; @@ -144,9 +147,6 @@ pub mod iter { } } - use libimagentrylink::external::iter::UrlIter; - use regex::Regex; - pub struct LinksMatchingRegexIter<'a>(UrlIter<'a>, Regex); impl<'a> LinksMatchingRegexIter<'a> { diff --git a/lib/domain/libimagbookmark/src/lib.rs b/lib/domain/libimagbookmark/src/lib.rs index 6072070c..c8b2c59c 100644 --- a/lib/domain/libimagbookmark/src/lib.rs +++ b/lib/domain/libimagbookmark/src/lib.rs @@ -44,6 +44,7 @@ extern crate regex; #[macro_use] extern crate libimagstore; extern crate libimagerror; extern crate libimagentrylink; +extern crate libimagentryurl; module_entry_path_mod!("bookmark");