summaryrefslogtreecommitdiffstats
path: root/libimagentrylink
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-08-28 13:41:28 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-08-31 09:20:08 +0200
commitd594b7c6a252f127fb6db0ae005fe61f4eb7a390 (patch)
tree66e5586a1b993ebb4b3475f6878aa0f4b4b424a5 /libimagentrylink
parentb2806ab5929969c02aa054f3d941177c7de75393 (diff)
Reimplement libimagentrylink::external::is_external_link_storeid() using StoreId::is_in_collection()
Diffstat (limited to 'libimagentrylink')
-rw-r--r--libimagentrylink/src/external.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/libimagentrylink/src/external.rs b/libimagentrylink/src/external.rs
index 11c524a0..171db965 100644
--- a/libimagentrylink/src/external.rs
+++ b/libimagentrylink/src/external.rs
@@ -91,16 +91,8 @@ pub trait ExternalLinker : InternalLinker {
/// Check whether the StoreId starts with `/link/external/`
pub fn is_external_link_storeid(id: &StoreId) -> bool {
- use std::path::Component;
-
debug!("Checking whether this is a link/external/*: '{:?}'", id);
- id.components()
- .take(2)
- .zip(&["link", "external"])
- .map(|(c, pred)| match c {
- Component::Normal(ref s) => s.to_str().map(|ref s| s == pred).unwrap_or(false),
- _ => false
- }).all(|x| x)
+ id.is_in_collection(&["link", "external"])
}
fn get_external_link_from_file(entry: &FileLockEntry) -> Result<Url> {