diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-09-04 10:40:38 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-09-04 10:40:38 +0200 |
commit | ccffeb91a2d91feabe7720f6f3c28a8c012cf680 (patch) | |
tree | a31d0100103c835e7b95a9c56fdc67b4aea98c45 /libimagentrylink | |
parent | 253c8a6f548508c4096252d03403bf3d10ac5d99 (diff) |
Remove StoreId::is_in_collection(), add StoreId::local()
Having a ::is_in_collection() is a nice thing, though it is _way_ better
if we just give the user of the `StoreId` object access to the local
part of the ID.
Using this new function, one can do all the actions one might need on
the Path for the actual entry without nasty copying or such.
`StoreId::is_in_collection()` can be replaced by
`StoreId::local().starts_with()` and everything is fine, as we do not
have to move a `PathBuf` object into the function anymore.
Diffstat (limited to 'libimagentrylink')
-rw-r--r-- | libimagentrylink/src/external.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libimagentrylink/src/external.rs b/libimagentrylink/src/external.rs index ca095907..a6c2faef 100644 --- a/libimagentrylink/src/external.rs +++ b/libimagentrylink/src/external.rs @@ -91,10 +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::PathBuf; - debug!("Checking whether this is a link/external/*: '{:?}'", id); - id.is_in_collection(&PathBuf::from("link/external")) + id.local().starts_with("link/external") } fn get_external_link_from_file(entry: &FileLockEntry) -> Result<Url> { |