Refactor imag-todo to fit new store iterator interface

This commit is contained in:
Matthias Beyer 2018-04-30 19:24:05 +02:00
parent eaf8148cda
commit e6244d7e9e

View file

@ -50,6 +50,7 @@ use libimagrt::runtime::Runtime;
use libimagrt::setup::generate_runtime_setup; use libimagrt::setup::generate_runtime_setup;
use libimagtodo::taskstore::TaskStore; use libimagtodo::taskstore::TaskStore;
use libimagerror::trace::{MapErrTrace, trace_error}; use libimagerror::trace::{MapErrTrace, trace_error};
use libimagerror::iter::TraceIterator;
use libimagerror::exit::ExitUnwrap; use libimagerror::exit::ExitUnwrap;
use libimagerror::io::ToExitCode; use libimagerror::io::ToExitCode;
@ -124,7 +125,7 @@ fn list(rt: &Runtime) {
let res = rt.store().all_tasks() // get all tasks let res = rt.store().all_tasks() // get all tasks
.map(|iter| { // and if this succeeded .map(|iter| { // and if this succeeded
// filter out the ones were we can read the uuid // filter out the ones were we can read the uuid
let uuids : Vec<_> = iter.filter_map(|storeid| { let uuids : Vec<_> = iter.trace_unwrap_exit(1).filter_map(|storeid| {
match rt.store().retrieve(storeid) { match rt.store().retrieve(storeid) {
Ok(fle) => { Ok(fle) => {
match fle.get_header().read_string("todo.uuid") { match fle.get_header().read_string("todo.uuid") {