summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/core/imag-git/src/lib.rs4
-rw-r--r--bin/domain/imag-timetrack/src/shell.rs2
-rw-r--r--bin/domain/imag-timetrack/src/stop.rs2
-rw-r--r--bin/domain/imag-todo/src/import.rs2
-rw-r--r--lib/core/libimagrt/src/runtime.rs4
-rw-r--r--lib/core/libimagstore/src/store.rs2
-rw-r--r--lib/entry/libimagentrylink/src/linkable.rs28
7 files changed, 22 insertions, 22 deletions
diff --git a/bin/core/imag-git/src/lib.rs b/bin/core/imag-git/src/lib.rs
index 94003d91..e398bd91 100644
--- a/bin/core/imag-git/src/lib.rs
+++ b/bin/core/imag-git/src/lib.rs
@@ -100,7 +100,7 @@ impl ImagApplication for ImagGit {
.cli()
.values_of("")
.map(|vs| vs.map(String::from).collect())
- .unwrap_or_else(|| vec![]);
+ .unwrap_or_else(Vec::new);
debug!("Adding args = {:?}", args);
command.args(&args);
@@ -110,7 +110,7 @@ impl ImagApplication for ImagGit {
let args = ext_m
.values_of("")
.map(|vs| vs.map(String::from).collect())
- .unwrap_or_else(|| vec![]);
+ .unwrap_or_else(Vec::new);
debug!("Adding subcommand '{}' and args = {:?}", external, args);
command.args(&args);
diff --git a/bin/domain/imag-timetrack/src/shell.rs b/bin/domain/imag-timetrack/src/shell.rs
index f4dde8d9..0761f662 100644
--- a/bin/domain/imag-timetrack/src/shell.rs
+++ b/bin/domain/imag-timetrack/src/shell.rs
@@ -84,7 +84,7 @@ pub fn shell(rt: &Runtime) -> Result<()> {
.get_timetrackings()?
.filter_ok(|e| filter.filter(e))
.and_then_ok(|mut elem| {
- elem.set_end_datetime(stop.clone())?;
+ elem.set_end_datetime(stop)?;
debug!("Setting end time worked: {:?}", elem);
rt.report_touched(elem.get_location()).map_err(Error::from)
})
diff --git a/bin/domain/imag-timetrack/src/stop.rs b/bin/domain/imag-timetrack/src/stop.rs
index c2662f74..bf611595 100644
--- a/bin/domain/imag-timetrack/src/stop.rs
+++ b/bin/domain/imag-timetrack/src/stop.rs
@@ -75,7 +75,7 @@ pub fn stop(rt: &Runtime) -> Result<()> {
// for each of these timetrackings, end them
// for each result, print the backtrace (if any)
.and_then_ok(|mut elem| {
- elem.set_end_datetime(stop_time.clone())?;
+ elem.set_end_datetime(stop_time)?;
debug!("Setting end time worked: {:?}", elem);
rt.report_touched(elem.get_location()).map_err(Error::from)
})
diff --git a/bin/domain/imag-todo/src/import.rs b/bin/domain/imag-todo/src/import.rs
index f6688e96..0dbffe6f 100644
--- a/bin/domain/imag-todo/src/import.rs
+++ b/bin/domain/imag-todo/src/import.rs
@@ -128,7 +128,7 @@ fn import_taskwarrior(rt: &Runtime) -> Result<()> {
todo.get_content_mut().push_str(&anno);
}
- let dependends = task.depends().cloned().unwrap_or_else(|| vec![]);
+ let dependends = task.depends().cloned().unwrap_or_else(Vec::new);
Ok((*task.uuid(), dependends))
})
.collect::<Result<HashMap<Uuid, Vec<Uuid>>>>()?
diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs
index aaa89772..3451b7ad 100644
--- a/lib/core/libimagrt/src/runtime.rs
+++ b/lib/core/libimagrt/src/runtime.rs
@@ -530,7 +530,7 @@ impl<'a> Runtime<'a> {
let subcommand_args = args.values_of("")
.map(|sx| sx.map(String::from).collect())
- .unwrap_or_else(|| vec![]);
+ .unwrap_or_else(Vec::new);
Command::new(&command)
.stdin(::std::process::Stdio::inherit())
@@ -731,6 +731,6 @@ fn get_override_specs(matches: &ArgMatches) -> Vec<String> {
.map(String::from)
.collect()
})
- .unwrap_or_else(|| vec![])
+ .unwrap_or_else(Vec::new)
}
diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs
index 79eb5b3e..88d1ec3b 100644
--- a/lib/core/libimagstore/src/store.rs
+++ b/lib/core/libimagstore/src/store.rs
@@ -530,7 +530,7 @@ impl Store {
.context(anyhow!("MoveCallError: {} -> {}", entry.get_location(), new_id))?;
if hsmap.contains_key(&new_id) {
- return Err(anyhow!("Entry exists already: {}", new_id.clone()))
+ return Err(anyhow!("Entry exists already: {}", new_id))
.context(anyhow!("MoveCallError: {} -> {}", entry.get_location(), new_id))
.map_err(Error::from)
}
diff --git a/lib/entry/libimagentrylink/src/linkable.rs b/lib/entry/libimagentrylink/src/linkable.rs
index 7476d82b..0fd04472 100644
--- a/lib/entry/libimagentrylink/src/linkable.rs
+++ b/lib/entry/libimagentrylink/src/linkable.rs
@@ -101,10 +101,10 @@ impl Linkable for Entry {
partial
.internal
- .unwrap_or_else(|| vec![])
+ .unwrap_or_else(Vec::new)
.into_iter()
- .chain(partial.from.unwrap_or_else(|| vec![]).into_iter())
- .chain(partial.to.unwrap_or_else(|| vec![]).into_iter())
+ .chain(partial.from.unwrap_or_else(Vec::new).into_iter())
+ .chain(partial.to.unwrap_or_else(Vec::new).into_iter())
.map(PathBuf::from)
.map(StoreId::new)
.map(|r| r.map(Link::from))
@@ -121,7 +121,7 @@ impl Linkable for Entry {
.read_partial::<LinkPartial>()?
.unwrap_or_else(Default::default)
.internal
- .unwrap_or_else(|| vec![])
+ .unwrap_or_else(Vec::new)
.into_iter();
link_string_iter_to_link_iter(iter)
@@ -136,7 +136,7 @@ impl Linkable for Entry {
.read_partial::<LinkPartial>()?
.unwrap_or_else(Default::default)
.to
- .unwrap_or_else(|| vec![])
+ .unwrap_or_else(Vec::new)
.into_iter();
link_string_iter_to_link_iter(iter)
@@ -151,7 +151,7 @@ impl Linkable for Entry {
.read_partial::<LinkPartial>()?
.unwrap_or_else(Default::default)
.from
- .unwrap_or_else(|| vec![])
+ .unwrap_or_else(Vec::new)
.into_iter();
link_string_iter_to_link_iter(iter)
@@ -163,7 +163,7 @@ impl Linkable for Entry {
let right_location = other.get_location().to_str()?;
alter_linking(self, other, |mut left, mut right| {
- let mut left_internal = left.internal.unwrap_or_else(|| vec![]);
+ let mut left_internal = left.internal.unwrap_or_else(Vec::new);
trace!("left: {:?} <- {:?}", left_internal, right_location);
left_internal.push(right_location);
trace!("left: {:?}", left_internal);
@@ -171,7 +171,7 @@ impl Linkable for Entry {
left_internal.sort_unstable();
left_internal.dedup();
- let mut right_internal = right.internal.unwrap_or_else(|| vec![]);
+ let mut right_internal = right.internal.unwrap_or_else(Vec::new);
trace!("right: {:?} <- {:?}", right_internal, left_location);
right_internal.push(left_location);
trace!("right: {:?}", right_internal);
@@ -193,7 +193,7 @@ impl Linkable for Entry {
let right_location = other.get_location().to_str()?;
alter_linking(self, other, |mut left, mut right| {
- let mut left_internal = left.internal.unwrap_or_else(|| vec![]);
+ let mut left_internal = left.internal.unwrap_or_else(Vec::new);
trace!("left: {:?} retaining {:?}", left_internal, right_location);
left_internal.retain(|l| *l != right_location);
trace!("left: {:?}", left_internal);
@@ -201,7 +201,7 @@ impl Linkable for Entry {
left_internal.sort_unstable();
left_internal.dedup();
- let mut right_internal = right.internal.unwrap_or_else(|| vec![]);
+ let mut right_internal = right.internal.unwrap_or_else(Vec::new);
trace!("right: {:?} retaining {:?}", right_internal, left_location);
right_internal.retain(|l| *l != left_location);
trace!("right: {:?}", right_internal);
@@ -234,12 +234,12 @@ impl Linkable for Entry {
let right_location = other.get_location().to_str()?;
alter_linking(self, other, |mut left, mut right| {
- let mut left_to = left.to.unwrap_or_else(|| vec![]);
+ let mut left_to = left.to.unwrap_or_else(Vec::new);
trace!("left_to: {:?} <- {:?}", left_to, right_location);
left_to.push(right_location);
trace!("left_to: {:?}", left_to);
- let mut right_from = right.from.unwrap_or_else(|| vec![]);
+ let mut right_from = right.from.unwrap_or_else(Vec::new);
trace!("right_from: {:?} <- {:?}", right_from, left_location);
right_from.push(left_location);
trace!("right_from: {:?}", right_from);
@@ -258,12 +258,12 @@ impl Linkable for Entry {
let right_location = other.get_location().to_str()?;
alter_linking(self, other, |mut left, mut right| {
- let mut left_to = left.to.unwrap_or_else(|| vec![]);
+ let mut left_to = left.to.unwrap_or_else(Vec::new);
trace!("left_to: {:?} retaining {:?}", left_to, right_location);
left_to.retain(|l| *l != right_location);
trace!("left_to: {:?}", left_to);
- let mut right_from = right.from.unwrap_or_else(|| vec![]);
+ let mut right_from = right.from.unwrap_or_else(Vec::new);
trace!("right_from: {:?} retaining {:?}", right_from, left_location);
right_from.retain(|l| *l != left_location);
trace!("right_from: {:?}", right_from);