Merge branch 'minor'

This commit is contained in:
Matthias Beyer 2018-12-03 01:09:03 +01:00
commit 37ac37f22e
3 changed files with 8 additions and 16 deletions

View file

@ -16,7 +16,7 @@ matrix:
- bash ./scripts/branch-contains-no-tmp-commits
- bash ./scripts/version-updated
- language: rust
rust: 1.28.0
rust: 1.29.2
cache:
directories:
- /home/travis/.cargo
@ -26,7 +26,7 @@ matrix:
- cargo build --all --all-features -j 1 || exit 1
- cargo test --all --all-features -j 1 || exit 1
- language: rust
rust: 1.29.2
rust: 1.30.1
cache:
directories:
- /home/travis/.cargo

View file

@ -120,15 +120,10 @@ impl StoreId {
}
pub fn to_str(&self) -> Result<String> {
self.base
.as_ref()
.cloned()
.map(|mut base| { base.push(self.id.clone()); base })
.unwrap_or_else(|| self.id.clone())
.to_str()
.map(String::from)
.ok_or_else(|| err_msg("Store ID Handling error"))
.map_err(Error::from)
match self.base.as_ref() {
None => Ok(self.id.display().to_string()),
Some(ref base) => Ok(format!("{}/{}", base.display(), self.id.display())),
}
}
/// Helper function for creating a displayable String from StoreId
@ -192,10 +187,7 @@ impl StoreId {
impl Display for StoreId {
fn fmt(&self, fmt: &mut Formatter) -> RResult<(), FmtError> {
match self.id.to_str() {
Some(s) => write!(fmt, "{}", s),
None => write!(fmt, "{}", self.id.to_string_lossy()),
}
write!(fmt, "{}", self.id.display())
}
}

View file

@ -301,7 +301,7 @@ pub mod iter {
/// Check whether the StoreId starts with `/link/external/`
pub fn is_external_link_storeid<A: AsRef<StoreId> + Debug>(id: A) -> bool {
debug!("Checking whether this is a 'links/external/': '{:?}'", id);
id.as_ref().local().starts_with("links/external")
id.as_ref().is_in_collection(&["links", "external"])
}
/// Implement `ExternalLinker` for `Entry`, hiding the fact that there is no such thing as an external