diff --git a/imag-diary/src/list.rs b/imag-diary/src/list.rs index 413213c0..9c0cc3c5 100644 --- a/imag-diary/src/list.rs +++ b/imag-diary/src/list.rs @@ -7,6 +7,7 @@ use libimagdiary::error::DiaryErrorKind as DEK; use libimagentrylist::listers::core::CoreLister; use libimagentrylist::lister::Lister; use libimagrt::runtime::Runtime; +use libimagstore::store::Entry; use libimagstore::storeid::StoreId; use libimagerror::trace::trace_error; @@ -41,7 +42,7 @@ pub fn list(rt: &Runtime) { let base = rt.store().path(); - CoreLister::new(&move |e| location_to_listing_string(e.get_location(), base)) + CoreLister::new(&move |e: &Entry| location_to_listing_string(e.get_location(), base)) .list(es) // TODO: Do not ignore non-ok()s .map_err(|e| DE::new(DEK::IOError, Some(Box::new(e)))) }) diff --git a/libimagentrylist/src/listers/core.rs b/libimagentrylist/src/listers/core.rs index 50913258..f2f83eea 100644 --- a/libimagentrylist/src/listers/core.rs +++ b/libimagentrylist/src/listers/core.rs @@ -7,21 +7,21 @@ use result::Result; use libimagstore::store::FileLockEntry; use libimagstore::store::Entry; -pub struct CoreLister<'a> { - lister: &'a Fn(&Entry) -> String, +pub struct CoreLister String> { + lister: Box, } -impl<'a> CoreLister<'a> { +impl String> CoreLister { - pub fn new(lister: &'a Fn(&Entry) -> String) -> CoreLister<'a> { + pub fn new(lister: T) -> CoreLister { CoreLister { - lister: lister, + lister: Box::new(lister), } } } -impl<'a> Lister for CoreLister<'a> { +impl String> Lister for CoreLister { fn list<'b, I: Iterator>>(&self, entries: I) -> Result<()> { use error::ListError as LE;