Fix libimagbookmark for new url library
This commit is contained in:
parent
c33c29e8e2
commit
8a5bc09b62
3 changed files with 8 additions and 6 deletions
|
@ -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" }
|
||||
|
||||
|
|
|
@ -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<UrlIter<'a>>;
|
||||
fn link_entries(&self) -> Result<Vec<StoreLink>>;
|
||||
fn add_link(&mut self, store: &Store, l: Link) -> Result<Vec<StoreId>>;
|
||||
|
@ -95,7 +95,7 @@ impl BookmarkCollection for Entry {
|
|||
}
|
||||
|
||||
fn link_entries(&self) -> Result<Vec<StoreLink>> {
|
||||
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>(I)
|
||||
where I: Iterator<Item = Link>;
|
||||
|
@ -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> {
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
Loading…
Reference in a new issue