Use StoreId::into_pathbuf() rather than ::into()

This commit is contained in:
Matthias Beyer 2016-09-06 09:40:27 +02:00
parent 5f04d29345
commit a53adb854d

View file

@ -3,6 +3,7 @@ use std::io::Write;
use lister::Lister;
use result::Result;
use error::MapErrInto;
use libimagstore::store::FileLockEntry;
use libimagutil::iter::FoldResult;
@ -26,12 +27,11 @@ 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| pb.into_pathbuf().map_err_into(LEK::FormatError))
.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 {