Fix imag-log for new Diary::entries() interface

This commit is contained in:
Matthias Beyer 2018-03-02 23:27:20 +01:00
parent affd15a890
commit eccb52a85c
2 changed files with 10 additions and 1 deletions

View file

@ -27,6 +27,7 @@ toml = "0.4"
toml-query = "0.6" toml-query = "0.6"
is-match = "0.1" is-match = "0.1"
libimagstore = { version = "0.7.0", path = "../../../lib/core/libimagstore" }
libimagrt = { version = "0.7.0", path = "../../../lib/core/libimagrt" } libimagrt = { version = "0.7.0", path = "../../../lib/core/libimagrt" }
libimagerror = { version = "0.7.0", path = "../../../lib/core/libimagerror" } libimagerror = { version = "0.7.0", path = "../../../lib/core/libimagerror" }
libimagdiary = { version = "0.7.0", path = "../../../lib/domain/libimagdiary" } libimagdiary = { version = "0.7.0", path = "../../../lib/domain/libimagdiary" }

View file

@ -40,6 +40,7 @@ extern crate toml_query;
extern crate libimaglog; extern crate libimaglog;
#[macro_use] extern crate libimagrt; #[macro_use] extern crate libimagrt;
extern crate libimagstore;
extern crate libimagerror; extern crate libimagerror;
extern crate libimagdiary; extern crate libimagdiary;
@ -53,6 +54,7 @@ use libimagerror::exit::ExitUnwrap;
use libimagdiary::diary::Diary; use libimagdiary::diary::Diary;
use libimaglog::log::Log; use libimaglog::log::Log;
use libimaglog::error::LogError as LE; use libimaglog::error::LogError as LE;
use libimagstore::iter::get::StoreIdGetIteratorExtension;
mod ui; mod ui;
use ui::build_ui; use ui::build_ui;
@ -121,9 +123,15 @@ fn show(rt: &Runtime) {
}; };
for iter in iters { for iter in iters {
let _ = iter.map(|element| { let _ = iter.into_get_iter(rt.store()).map(|element| {
let e = element.map_err_trace_exit_unwrap(1); let e = element.map_err_trace_exit_unwrap(1);
if e.is_none() {
warn!("Failed to retrieve an entry from an existing store id");
return Ok(())
}
let e = e.unwrap(); // safe with above check
if !e.is_log().map_err_trace_exit_unwrap(1) { if !e.is_log().map_err_trace_exit_unwrap(1) {
return Ok(()); return Ok(());
} }