[Auto] bin/core/annotate: Fix Clippy warnings

Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
flip1995 2019-08-27 10:39:02 +02:00 committed by Matthias Beyer
parent 6b4c716388
commit 40c1f12b25
2 changed files with 8 additions and 10 deletions

View file

@ -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,

View file

@ -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<_>>>()