[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:
parent
6b4c716388
commit
40c1f12b25
2 changed files with 8 additions and 10 deletions
|
@ -116,7 +116,7 @@ fn add(rt: &Runtime) {
|
||||||
.annotate(rt.store())
|
.annotate(rt.store())
|
||||||
.map_err_trace_exit_unwrap();
|
.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 {
|
for id in ids {
|
||||||
let mut entry = rt.store().get(id.clone())
|
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()))
|
.ok_or_else(|| format_err!("Not found: {}", id.local_display_string()))
|
||||||
.map_err_trace_exit_unwrap();
|
.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") {
|
if !scmd.is_present("dont-print-name") {
|
||||||
|
@ -134,7 +134,7 @@ fn add(rt: &Runtime) {
|
||||||
.map_err(Error::from)
|
.map_err(Error::from)
|
||||||
.map_err_trace_exit_unwrap()
|
.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()
|
.to_exit_code()
|
||||||
.unwrap_or_exit();
|
.unwrap_or_exit();
|
||||||
} else {
|
} else {
|
||||||
|
@ -160,7 +160,7 @@ fn remove(rt: &Runtime) {
|
||||||
})
|
})
|
||||||
.into_iter();
|
.into_iter();
|
||||||
|
|
||||||
ids.into_iter().for_each(|id| {
|
ids.for_each(|id| {
|
||||||
let mut entry = rt.store()
|
let mut entry = rt.store()
|
||||||
.get(id.clone())
|
.get(id.clone())
|
||||||
.map_err_trace_exit_unwrap()
|
.map_err_trace_exit_unwrap()
|
||||||
|
@ -178,7 +178,7 @@ fn remove(rt: &Runtime) {
|
||||||
let loc = an.get_location().clone();
|
let loc = an.get_location().clone();
|
||||||
drop(an);
|
drop(an);
|
||||||
|
|
||||||
let _ = rt
|
rt
|
||||||
.store()
|
.store()
|
||||||
.delete(loc)
|
.delete(loc)
|
||||||
.map_err_trace_exit_unwrap();
|
.map_err_trace_exit_unwrap();
|
||||||
|
@ -205,10 +205,9 @@ fn list(rt: &Runtime) {
|
||||||
.into_iter();
|
.into_iter();
|
||||||
|
|
||||||
if ids.len() != 0 {
|
if ids.len() != 0 {
|
||||||
let _ = ids
|
ids
|
||||||
.into_iter()
|
|
||||||
.for_each(|id| {
|
.for_each(|id| {
|
||||||
let _ = rt
|
rt
|
||||||
.store()
|
.store()
|
||||||
.get(id.clone())
|
.get(id.clone())
|
||||||
.map_err_trace_exit_unwrap()
|
.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) {
|
fn list_annotation<'a>(rt: &Runtime, i: usize, a: FileLockEntry<'a>, with_text: bool) {
|
||||||
let _ = if with_text {
|
if with_text {
|
||||||
writeln!(rt.stdout(),
|
writeln!(rt.stdout(),
|
||||||
"--- {i: >5} | {id}\n{text}\n\n",
|
"--- {i: >5} | {id}\n{text}\n\n",
|
||||||
i = i,
|
i = i,
|
||||||
|
|
|
@ -102,7 +102,6 @@ impl IdPathProvider for PathProvider {
|
||||||
fn get_id_paths(subm: &ArgMatches) -> Result<Option<Vec<StoreId>>> {
|
fn get_id_paths(subm: &ArgMatches) -> Result<Option<Vec<StoreId>>> {
|
||||||
subm.values_of("entry")
|
subm.values_of("entry")
|
||||||
.map(|v| v
|
.map(|v| v
|
||||||
.into_iter()
|
|
||||||
.map(PathBuf::from)
|
.map(PathBuf::from)
|
||||||
.map(|pb| pb.into_storeid())
|
.map(|pb| pb.into_storeid())
|
||||||
.collect::<Result<Vec<_>>>()
|
.collect::<Result<Vec<_>>>()
|
||||||
|
|
Loading…
Reference in a new issue