Merge pull request #431 from matthiasbeyer/libimagentrylister/core-counter
Add counter in libimagentrylist::listers::Core
This commit is contained in:
commit
297610f46b
1 changed files with 13 additions and 6 deletions
|
@ -27,12 +27,19 @@ impl<'a> Lister for CoreLister<'a> {
|
||||||
use error::ListError as LE;
|
use error::ListError as LE;
|
||||||
use error::ListErrorKind as LEK;
|
use error::ListErrorKind as LEK;
|
||||||
|
|
||||||
entries.fold(Ok(()), |accu, entry| {
|
debug!("Called list()");
|
||||||
accu.and_then(|_| {
|
let (r, n) = entries
|
||||||
write!(stdout(), "{:?}\n", (self.lister)(&entry))
|
.fold((Ok(()), 0), |(accu, i), entry| {
|
||||||
.map_err(|e| LE::new(LEK::FormatError, Some(Box::new(e))))
|
debug!("fold({:?}, {:?})", accu, entry);
|
||||||
})
|
let r = accu.and_then(|_| {
|
||||||
})
|
debug!("Listing Entry: {:?}", entry);
|
||||||
|
write!(stdout(), "{:?}\n", (self.lister)(&entry))
|
||||||
|
.map_err(|e| LE::new(LEK::FormatError, Some(Box::new(e))))
|
||||||
|
});
|
||||||
|
(r, i + 1)
|
||||||
|
});
|
||||||
|
debug!("Iterated over {} entries", n);
|
||||||
|
r
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue