diff options
author | flip1995 <hello@philkrones.com> | 2019-08-27 10:15:26 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2019-08-28 18:18:41 +0200 |
commit | daddea7adf8514178b492fe424098ef2bb1e7a3a (patch) | |
tree | 204c7e487e74b687da3a10fa9a1bcf72a84fed8c /bin/domain/imag-timetrack | |
parent | 4529ebf21614bf27f0884b34cab807ac2af6b519 (diff) |
[No-auto] bin/domain/timetrack: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin/domain/imag-timetrack')
-rw-r--r-- | bin/domain/imag-timetrack/src/day.rs | 4 | ||||
-rw-r--r-- | bin/domain/imag-timetrack/src/list.rs | 2 | ||||
-rw-r--r-- | bin/domain/imag-timetrack/src/month.rs | 2 | ||||
-rw-r--r-- | bin/domain/imag-timetrack/src/stop.rs | 12 | ||||
-rw-r--r-- | bin/domain/imag-timetrack/src/week.rs | 2 | ||||
-rw-r--r-- | bin/domain/imag-timetrack/src/year.rs | 2 |
6 files changed, 9 insertions, 15 deletions
diff --git a/bin/domain/imag-timetrack/src/day.rs b/bin/domain/imag-timetrack/src/day.rs index 9e7e8ba6..3bcd0990 100644 --- a/bin/domain/imag-timetrack/src/day.rs +++ b/bin/domain/imag-timetrack/src/day.rs @@ -67,7 +67,7 @@ pub fn day(rt: &Runtime) -> i32 { let tags = cmd .values_of("tags") - .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect()); + .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect::<Vec<_>>()); let start_time_filter = has_start_time_where(move |dt: &NaiveDateTime| { start <= *dt @@ -78,7 +78,7 @@ pub fn day(rt: &Runtime) -> i32 { }); let tags_filter = move |fle: &FileLockEntry| { - match tags { + match &tags { Some(ref tags) => has_one_of_tags(&tags).filter(fle), None => true, } diff --git a/bin/domain/imag-timetrack/src/list.rs b/bin/domain/imag-timetrack/src/list.rs index 8a733dd0..c323cf29 100644 --- a/bin/domain/imag-timetrack/src/list.rs +++ b/bin/domain/imag-timetrack/src/list.rs @@ -53,7 +53,7 @@ pub fn list(rt: &Runtime) -> i32 { ::std::process::exit(1) }); - Some(dt.clone()) + Some(*dt) }, Err(e) => { error!("Failed to calculate date from '{}': {:?}", diff --git a/bin/domain/imag-timetrack/src/month.rs b/bin/domain/imag-timetrack/src/month.rs index c6f617b7..19d12ebe 100644 --- a/bin/domain/imag-timetrack/src/month.rs +++ b/bin/domain/imag-timetrack/src/month.rs @@ -82,7 +82,7 @@ pub fn month(rt: &Runtime) -> i32 { let tags = cmd .values_of("tags") - .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect()); + .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect::<Vec<_>>()); let start_time_filter = has_start_time_where(move |dt: &NaiveDateTime| { start <= *dt diff --git a/bin/domain/imag-timetrack/src/stop.rs b/bin/domain/imag-timetrack/src/stop.rs index a7fc1f88..5a7f76a3 100644 --- a/bin/domain/imag-timetrack/src/stop.rs +++ b/bin/domain/imag-timetrack/src/stop.rs @@ -60,17 +60,11 @@ pub fn stop(rt: &Runtime) -> i32 { .get_timetrackings() .map_err_trace_exit_unwrap() .trace_unwrap() - .filter_map(|tracking| { - let is_none = tracking + .filter(|tracking| { + tracking .get_end_datetime() .map_err_trace_exit_unwrap() - .is_none(); - - if is_none { - Some(tracking) - } else { - None - } + .is_none() }) .map(|t| t.get_timetrack_tag()) .map(|r| r.map_err_trace_exit_unwrap()) diff --git a/bin/domain/imag-timetrack/src/week.rs b/bin/domain/imag-timetrack/src/week.rs index 9deb223d..fe9a4d4d 100644 --- a/bin/domain/imag-timetrack/src/week.rs +++ b/bin/domain/imag-timetrack/src/week.rs @@ -80,7 +80,7 @@ pub fn week(rt: &Runtime) -> i32 { let tags = cmd .values_of("tags") - .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect()); + .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect::<Vec<_>>()); let start_time_filter = has_start_time_where(move |dt: &NaiveDateTime| { start <= *dt diff --git a/bin/domain/imag-timetrack/src/year.rs b/bin/domain/imag-timetrack/src/year.rs index 5803b948..d1efaf93 100644 --- a/bin/domain/imag-timetrack/src/year.rs +++ b/bin/domain/imag-timetrack/src/year.rs @@ -79,7 +79,7 @@ pub fn year(rt: &Runtime) -> i32 { let tags = cmd .values_of("tags") - .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect()); + .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect::<Vec<_>>()); let start_time_filter = has_start_time_where(move |dt: &NaiveDateTime| { start <= *dt |