summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 10:39:02 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:40 +0200
commit40c1f12b251f15c1ecb19a54b3227929a269bb9a (patch)
treeeab0c11f125271f10f4d3f728917ce04e88676b4 /bin
parent6b4c716388ef94fcfc0e0b43404edcb4eb0e0de8 (diff)
[Auto] bin/core/annotate: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin')
-rw-r--r--bin/core/imag-annotate/src/main.rs17
-rw-r--r--bin/core/imag-annotate/src/ui.rs1
2 files changed, 8 insertions, 10 deletions
diff --git a/bin/core/imag-annotate/src/main.rs b/bin/core/imag-annotate/src/main.rs
index d1f5dafc..74c9aac8 100644
--- a/bin/core/imag-annotate/src/main.rs
+++ b/bin/core/imag-annotate/src/main.rs
@@ -116,7 +116,7 @@ fn add(rt: &Runtime) {
.annotate(rt.store())
.map_err_trace_exit_unwrap();
- let _ = annotation.edit_content(&rt).map_err_trace_exit_unwrap();
+ annotation.edit_content(&rt).map_err_trace_exit_unwrap();
for id in ids {
let mut entry = rt.store().get(id.clone())
@@ -124,7 +124,7 @@ fn add(rt: &Runtime) {
.ok_or_else(|| format_err!("Not found: {}", id.local_display_string()))
.map_err_trace_exit_unwrap();
- let _ = entry.add_link(&mut annotation).map_err_trace_exit_unwrap();
+ entry.add_link(&mut annotation).map_err_trace_exit_unwrap();
}
if !scmd.is_present("dont-print-name") {
@@ -134,7 +134,7 @@ fn add(rt: &Runtime) {
.map_err(Error::from)
.map_err_trace_exit_unwrap()
{
- let _ = writeln!(rt.stdout(), "Name of the annotation: {}", annotation_id)
+ writeln!(rt.stdout(), "Name of the annotation: {}", annotation_id)
.to_exit_code()
.unwrap_or_exit();
} else {
@@ -160,7 +160,7 @@ fn remove(rt: &Runtime) {
})
.into_iter();
- ids.into_iter().for_each(|id| {
+ ids.for_each(|id| {
let mut entry = rt.store()
.get(id.clone())
.map_err_trace_exit_unwrap()
@@ -178,7 +178,7 @@ fn remove(rt: &Runtime) {
let loc = an.get_location().clone();
drop(an);
- let _ = rt
+ rt
.store()
.delete(loc)
.map_err_trace_exit_unwrap();
@@ -205,10 +205,9 @@ fn list(rt: &Runtime) {
.into_iter();
if ids.len() != 0 {
- let _ = ids
- .into_iter()
+ ids
.for_each(|id| {
- let _ = rt
+ rt
.store()
.get(id.clone())
.map_err_trace_exit_unwrap()
@@ -239,7 +238,7 @@ fn list(rt: &Runtime) {
}
fn list_annotation<'a>(rt: &Runtime, i: usize, a: FileLockEntry<'a>, with_text: bool) {
- let _ = if with_text {
+ if with_text {
writeln!(rt.stdout(),
"--- {i: >5} | {id}\n{text}\n\n",
i = i,
diff --git a/bin/core/imag-annotate/src/ui.rs b/bin/core/imag-annotate/src/ui.rs
index 2ad23262..fe7dc4f3 100644
--- a/bin/core/imag-annotate/src/ui.rs
+++ b/bin/core/imag-annotate/src/ui.rs
@@ -102,7 +102,6 @@ impl IdPathProvider for PathProvider {
fn get_id_paths(subm: &ArgMatches) -> Result<Option<Vec<StoreId>>> {
subm.values_of("entry")
.map(|v| v
- .into_iter()
.map(PathBuf::from)
.map(|pb| pb.into_storeid())
.collect::<Result<Vec<_>>>()