summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 10:44:03 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:40 +0200
commitf7f95a651f74f01beb393b4352ba6507e0f26241 (patch)
treef0ade4fdab275c55cbbbd92dd833221a3fbf1889
parente0e4d4e72084e33964a46fd10c8fc8acdd6091a1 (diff)
[Auto] bin/core/timetrack: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--bin/domain/imag-timetrack/src/cont.rs3
-rw-r--r--bin/domain/imag-timetrack/src/day.rs4
-rw-r--r--bin/domain/imag-timetrack/src/list.rs4
-rw-r--r--bin/domain/imag-timetrack/src/month.rs4
-rw-r--r--bin/domain/imag-timetrack/src/shell.rs6
-rw-r--r--bin/domain/imag-timetrack/src/start.rs2
-rw-r--r--bin/domain/imag-timetrack/src/stop.rs2
-rw-r--r--bin/domain/imag-timetrack/src/track.rs6
-rw-r--r--bin/domain/imag-timetrack/src/week.rs4
-rw-r--r--bin/domain/imag-timetrack/src/year.rs4
10 files changed, 19 insertions, 20 deletions
diff --git a/bin/domain/imag-timetrack/src/cont.rs b/bin/domain/imag-timetrack/src/cont.rs
index 2c902f85..e5efb16a 100644
--- a/bin/domain/imag-timetrack/src/cont.rs
+++ b/bin/domain/imag-timetrack/src/cont.rs
@@ -67,7 +67,6 @@ pub fn cont(rt: &Runtime) -> i32 {
let (k2, _) = *t2;
Ord::cmp(&k1, &k2)
})
- .into_iter()
// get the last one, which should be the highest one
.last() // -> Option<_>
@@ -88,7 +87,7 @@ pub fn cont(rt: &Runtime) -> i32 {
.map(|_| 0)
.map_err_trace();
- let _ = rt.report_touched(tracking.get_location()).unwrap_or_exit();
+ rt.report_touched(tracking.get_location()).unwrap_or_exit();
val
})
diff --git a/bin/domain/imag-timetrack/src/day.rs b/bin/domain/imag-timetrack/src/day.rs
index 28b32cf5..9e7e8ba6 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.into_iter().map(String::from).map(TimeTrackingTag::from).collect());
+ .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect());
let start_time_filter = has_start_time_where(move |dt: &NaiveDateTime| {
start <= *dt
@@ -104,7 +104,7 @@ pub fn day(rt: &Runtime) -> i32 {
let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end);
- let _ = rt.report_touched(e.get_location()).unwrap_or_exit();
+ rt.report_touched(e.get_location()).unwrap_or_exit();
Ok((tag, start, end))
})
diff --git a/bin/domain/imag-timetrack/src/list.rs b/bin/domain/imag-timetrack/src/list.rs
index 88c91366..8a733dd0 100644
--- a/bin/domain/imag-timetrack/src/list.rs
+++ b/bin/domain/imag-timetrack/src/list.rs
@@ -66,7 +66,7 @@ pub fn list(rt: &Runtime) -> i32 {
::std::process::exit(1)
},
Some(Err(e)) => {
- let e = Error::from(e);
+ let e = e;
trace_error(&e);
::std::process::exit(1)
}
@@ -197,7 +197,7 @@ pub fn list_impl(rt: &Runtime,
.collect();
tab.add_row(Row::new(cells));
- let _ = rt.report_touched(e.get_location()).unwrap_or_exit();
+ rt.report_touched(e.get_location()).unwrap_or_exit();
table_empty = false;
Ok(tab)
diff --git a/bin/domain/imag-timetrack/src/month.rs b/bin/domain/imag-timetrack/src/month.rs
index b2ba38a7..c6f617b7 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.into_iter().map(String::from).map(TimeTrackingTag::from).collect());
+ .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect());
let start_time_filter = has_start_time_where(move |dt: &NaiveDateTime| {
start <= *dt
@@ -119,7 +119,7 @@ pub fn month(rt: &Runtime) -> i32 {
let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end);
- let _ = rt.report_touched(e.get_location()).unwrap_or_exit();
+ rt.report_touched(e.get_location()).unwrap_or_exit();
Ok((tag, start, end))
})
diff --git a/bin/domain/imag-timetrack/src/shell.rs b/bin/domain/imag-timetrack/src/shell.rs
index 97d659a8..c66bfe13 100644
--- a/bin/domain/imag-timetrack/src/shell.rs
+++ b/bin/domain/imag-timetrack/src/shell.rs
@@ -57,7 +57,7 @@ pub fn shell(rt: &Runtime) -> i32 {
mkshell(s.to_owned())
} else {
env::var("SHELL")
- .map(|s| mkshell(s))
+ .map(mkshell)
.map_err(|e| match e {
env::VarError::NotPresent => {
error!("No $SHELL variable in environment, cannot work!");
@@ -76,7 +76,7 @@ pub fn shell(rt: &Runtime) -> i32 {
match rt.store().create_timetracking_at(&start, tag) {
Err(e) => trace_error(&e),
Ok(entry) => {
- let _ = rt.report_touched(entry.get_location()).unwrap_or_exit();
+ rt.report_touched(entry.get_location()).unwrap_or_exit();
}
}
}
@@ -101,7 +101,7 @@ pub fn shell(rt: &Runtime) -> i32 {
trace_error(&e)
} else {
debug!("Setting end time worked: {:?}", elem);
- let _ = rt.report_touched(elem.get_location()).unwrap_or_exit();
+ rt.report_touched(elem.get_location()).unwrap_or_exit();
});
::std::process::exit(exit_code)
diff --git a/bin/domain/imag-timetrack/src/start.rs b/bin/domain/imag-timetrack/src/start.rs
index c9cd1c38..a4f99e91 100644
--- a/bin/domain/imag-timetrack/src/start.rs
+++ b/bin/domain/imag-timetrack/src/start.rs
@@ -59,7 +59,7 @@ pub fn start(rt: &Runtime) -> i32 {
1
},
Ok(entry) => {
- let _ = rt.report_touched(entry.get_location()).unwrap_or_exit();
+ rt.report_touched(entry.get_location()).unwrap_or_exit();
acc
}
diff --git a/bin/domain/imag-timetrack/src/stop.rs b/bin/domain/imag-timetrack/src/stop.rs
index 8bcd344b..a7fc1f88 100644
--- a/bin/domain/imag-timetrack/src/stop.rs
+++ b/bin/domain/imag-timetrack/src/stop.rs
@@ -99,7 +99,7 @@ pub fn stop(rt: &Runtime) -> i32 {
}
Ok(_) => {
debug!("Setting end time worked: {:?}", elem);
- let _ = rt.report_touched(elem.get_location()).unwrap_or_exit();
+ rt.report_touched(elem.get_location()).unwrap_or_exit();
acc
}
}
diff --git a/bin/domain/imag-timetrack/src/track.rs b/bin/domain/imag-timetrack/src/track.rs
index bcd5a601..0668f3f6 100644
--- a/bin/domain/imag-timetrack/src/track.rs
+++ b/bin/domain/imag-timetrack/src/track.rs
@@ -30,8 +30,8 @@ use libimagerror::exit::ExitUnwrap;
use libimagtimetrack::tag::TimeTrackingTag;
use libimagtimetrack::store::TimeTrackStore;
-const DATE_TIME_PARSE_FMT : &'static str = "%Y-%m-%dT%H:%M:%S";
-const DATE_PARSE_FMT : &'static str = "%Y-%m-%d";
+const DATE_TIME_PARSE_FMT : &str = "%Y-%m-%dT%H:%M:%S";
+const DATE_PARSE_FMT : &str = "%Y-%m-%d";
pub fn track(rt: &Runtime) -> i32 {
let (_, cmd) = rt.cli().subcommand();
@@ -87,7 +87,7 @@ pub fn track(rt: &Runtime) -> i32 {
1
},
Ok(entry) => {
- let _ = rt.report_touched(entry.get_location()).unwrap_or_exit();
+ rt.report_touched(entry.get_location()).unwrap_or_exit();
acc
}
})
diff --git a/bin/domain/imag-timetrack/src/week.rs b/bin/domain/imag-timetrack/src/week.rs
index 1c60beb5..9deb223d 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.into_iter().map(String::from).map(TimeTrackingTag::from).collect());
+ .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect());
let start_time_filter = has_start_time_where(move |dt: &NaiveDateTime| {
start <= *dt
@@ -117,7 +117,7 @@ pub fn week(rt: &Runtime) -> i32 {
let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end);
- let _ = rt.report_touched(e.get_location()).unwrap_or_exit();
+ rt.report_touched(e.get_location()).unwrap_or_exit();
Ok((tag, start, end))
})
diff --git a/bin/domain/imag-timetrack/src/year.rs b/bin/domain/imag-timetrack/src/year.rs
index edaf0253..5803b948 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.into_iter().map(String::from).map(TimeTrackingTag::from).collect());
+ .map(|ts| ts.map(String::from).map(TimeTrackingTag::from).collect());
let start_time_filter = has_start_time_where(move |dt: &NaiveDateTime| {
start <= *dt
@@ -117,7 +117,7 @@ pub fn year(rt: &Runtime) -> i32 {
let end = e.get_end_datetime()?;
debug!(" -> end = {:?}", end);
- let _ = rt.report_touched(e.get_location()).unwrap_or_exit();
+ rt.report_touched(e.get_location()).unwrap_or_exit();
Ok((tag, start, end))
})