[No-auto] bin/domain/timetrack: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
4529ebf216
commit
daddea7adf
6 changed files with 9 additions and 15 deletions
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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 '{}': {:?}",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue