From ecb9bcc861147c35b8170364ce56ee74b5e8e79e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 20 Jul 2017 12:29:42 +0200 Subject: [PATCH] Use filter fn from lib --- imag-timetrack/src/cont.rs | 3 +-- imag-timetrack/src/stop.rs | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/imag-timetrack/src/cont.rs b/imag-timetrack/src/cont.rs index 3f40d7f6..86563672 100644 --- a/imag-timetrack/src/cont.rs +++ b/imag-timetrack/src/cont.rs @@ -26,13 +26,12 @@ use itertools::Itertools; use itertools::MinMaxResult; use chrono::NaiveDateTime; -use common::has_end_time; - use libimagerror::trace::trace_error; use libimagerror::trace::MapErrTrace; use libimagerror::iter::TraceIterator; use libimagentrytimetrack::timetrackingstore::TimeTrackStore; use libimagentrytimetrack::timetracking::TimeTracking; +use libimagentrytimetrack::iter::filter::*; use libimagrt::runtime::Runtime; diff --git a/imag-timetrack/src/stop.rs b/imag-timetrack/src/stop.rs index f3dfaade..c1c5e682 100644 --- a/imag-timetrack/src/stop.rs +++ b/imag-timetrack/src/stop.rs @@ -21,8 +21,6 @@ use std::str::FromStr; use filters::filter::Filter; -use common::*; - use libimagerror::trace::trace_error; use libimagerror::iter::TraceIterator; use libimagrt::runtime::Runtime; @@ -32,6 +30,8 @@ use libimagentrytimetrack::timetracking::TimeTracking; use libimagentrytimetrack::tag::TimeTrackingTag; use libimagentrytimetrack::timetrackingstore::*; use libimagentrytimetrack::iter::get::GetTimeTrackIter; +use libimagentrytimetrack::iter::filter::has_end_time; +use libimagentrytimetrack::iter::filter::has_one_of_tags; pub fn stop(rt: &Runtime) -> i32 { let (_, cmd) = rt.cli().subcommand(); @@ -65,7 +65,7 @@ pub fn stop(rt: &Runtime) -> i32 { }; - let filter = has_end_time.not().and(HasTagFromList::new(&tags)); + let filter = has_end_time.not().and(has_one_of_tags(&tags)); // Filter all timetrackings for the ones that are not yet ended. iter.trace_unwrap()