Fix libimagentrylist::listers::{path, line}::* for new StoreId interface

This commit is contained in:
Matthias Beyer 2016-08-25 18:24:52 +02:00
parent f3727ca686
commit 11e2af0c14
2 changed files with 4 additions and 2 deletions

View file

@ -28,8 +28,8 @@ impl<'a> Lister for LineLister<'a> {
use error::ListErrorKind as LEK;
entries.fold_defresult(|entry| {
write!(stdout(), "{:?}\n", entry.get_location().to_str().unwrap_or(self.unknown_output))
.map_err(|e| LE::new(LEK::FormatError, Some(Box::new(e))))
let s = entry.get_location().to_str().unwrap_or(String::from(self.unknown_output));
write!(stdout(), "{:?}\n", s).map_err(|e| LE::new(LEK::FormatError, Some(Box::new(e))))
})
}

View file

@ -26,10 +26,12 @@ impl Lister for PathLister {
fn list<'a, I: Iterator<Item = FileLockEntry<'a>>>(&self, entries: I) -> Result<()> {
use error::ListError as LE;
use error::ListErrorKind as LEK;
use std::path::PathBuf;
entries.fold_defresult(|entry| {
Ok(entry.get_location().clone())
.and_then(|pb| {
let pb : PathBuf = pb.into();
if self.absolute {
pb.canonicalize().map_err(|e| LE::new(LEK::FormatError, Some(Box::new(e))))
} else {