[Auto] bin/core/store: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
b8e9c17dc8
commit
4d11ad2ac1
7 changed files with 12 additions and 12 deletions
|
@ -63,7 +63,7 @@ pub fn create(rt: &Runtime) {
|
||||||
}
|
}
|
||||||
.map_err_trace_exit_unwrap();
|
.map_err_trace_exit_unwrap();
|
||||||
|
|
||||||
let _ = rt.report_touched(&path).unwrap_or_exit();
|
rt.report_touched(&path).unwrap_or_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_from_cli_spec(rt: &Runtime, matches: &ArgMatches, path: &StoreId) -> Result<()> {
|
fn create_from_cli_spec(rt: &Runtime, matches: &ArgMatches, path: &StoreId) -> Result<()> {
|
||||||
|
@ -84,7 +84,7 @@ fn create_from_cli_spec(rt: &Runtime, matches: &ArgMatches, path: &StoreId) -> R
|
||||||
debug!("Got content with len = {}", content.len());
|
debug!("Got content with len = {}", content.len());
|
||||||
|
|
||||||
let header = matches.subcommand_matches("entry")
|
let header = matches.subcommand_matches("entry")
|
||||||
.map_or_else(|| Entry::default_header(),
|
.map_or_else(Entry::default_header,
|
||||||
|entry_matches| build_toml_header(entry_matches, Entry::default_header()));
|
|entry_matches| build_toml_header(entry_matches, Entry::default_header()));
|
||||||
|
|
||||||
create_with_content_and_header(rt, path, content, header)
|
create_with_content_and_header(rt, path, content, header)
|
||||||
|
|
|
@ -31,7 +31,7 @@ pub fn delete(rt: &Runtime) {
|
||||||
let path = StoreId::new(path).map_err_trace_exit_unwrap();
|
let path = StoreId::new(path).map_err_trace_exit_unwrap();
|
||||||
debug!("Deleting file at {:?}", id);
|
debug!("Deleting file at {:?}", id);
|
||||||
|
|
||||||
let _ = rt.store()
|
rt.store()
|
||||||
.delete(path)
|
.delete(path)
|
||||||
.map_warn_err(|e| format!("Error: {:?}", e))
|
.map_warn_err(|e| format!("Error: {:?}", e))
|
||||||
.map_err_trace_exit_unwrap();
|
.map_err_trace_exit_unwrap();
|
||||||
|
|
|
@ -34,10 +34,10 @@ pub fn get(rt: &Runtime) {
|
||||||
let path = StoreId::new(path).map_err_trace_exit_unwrap();
|
let path = StoreId::new(path).map_err_trace_exit_unwrap();
|
||||||
debug!("path = {:?}", path);
|
debug!("path = {:?}", path);
|
||||||
|
|
||||||
let _ = match rt.store().get(path.clone()).map_err_trace_exit_unwrap() {
|
match rt.store().get(path.clone()).map_err_trace_exit_unwrap() {
|
||||||
Some(entry) => {
|
Some(entry) => {
|
||||||
print_entry(rt, scmd, entry);
|
print_entry(rt, scmd, entry);
|
||||||
let _ = rt.report_touched(&path).unwrap_or_exit();
|
rt.report_touched(&path).unwrap_or_exit();
|
||||||
},
|
},
|
||||||
None => info!("No entry found"),
|
None => info!("No entry found"),
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,14 +47,14 @@ pub fn retrieve(rt: &Runtime) {
|
||||||
.map_dbg(|e| format!("{:?}", e))
|
.map_dbg(|e| format!("{:?}", e))
|
||||||
.map_err_trace_exit_unwrap();
|
.map_err_trace_exit_unwrap();
|
||||||
|
|
||||||
let _ = rt.report_touched(&path).unwrap_or_exit();
|
rt.report_touched(&path).unwrap_or_exit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
|
pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
|
||||||
if do_print_raw(scmd) {
|
if do_print_raw(scmd) {
|
||||||
debug!("Printing raw content...");
|
debug!("Printing raw content...");
|
||||||
let _ = writeln!(rt.stdout(), "{}", e.to_str().map_err_trace_exit_unwrap())
|
writeln!(rt.stdout(), "{}", e.to_str().map_err_trace_exit_unwrap())
|
||||||
.to_exit_code()
|
.to_exit_code()
|
||||||
.unwrap_or_exit();
|
.unwrap_or_exit();
|
||||||
} else if do_filter(scmd) {
|
} else if do_filter(scmd) {
|
||||||
|
@ -73,7 +73,7 @@ pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
} else {
|
} else {
|
||||||
debug!("Printing header as TOML...");
|
debug!("Printing header as TOML...");
|
||||||
let _ = writeln!(rt.stdout(), "{}", e.get_header())
|
writeln!(rt.stdout(), "{}", e.get_header())
|
||||||
.to_exit_code()
|
.to_exit_code()
|
||||||
.unwrap_or_exit();
|
.unwrap_or_exit();
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
|
||||||
|
|
||||||
if do_print_content(scmd) {
|
if do_print_content(scmd) {
|
||||||
debug!("Printing content...");
|
debug!("Printing content...");
|
||||||
let _ = writeln!(rt.stdout(), "{}", e.get_content())
|
writeln!(rt.stdout(), "{}", e.get_content())
|
||||||
.to_exit_code()
|
.to_exit_code()
|
||||||
.unwrap_or_exit();
|
.unwrap_or_exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ pub fn update(rt: &Runtime) {
|
||||||
debug!("New header set");
|
debug!("New header set");
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = rt.report_touched(locked_e.get_location()).unwrap_or_exit();
|
rt.report_touched(locked_e.get_location()).unwrap_or_exit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ use libimagutil::key_value_split::IntoKeyValue;
|
||||||
pub fn build_toml_header(matches: &ArgMatches, mut header: Value) -> Value {
|
pub fn build_toml_header(matches: &ArgMatches, mut header: Value) -> Value {
|
||||||
debug!("Building header from cli spec");
|
debug!("Building header from cli spec");
|
||||||
if let Some(headerspecs) = matches.values_of("header") {
|
if let Some(headerspecs) = matches.values_of("header") {
|
||||||
let kvs = headerspecs.into_iter()
|
let kvs = headerspecs
|
||||||
.filter_map(|hs| {
|
.filter_map(|hs| {
|
||||||
debug!("- Processing: '{}'", hs);
|
debug!("- Processing: '{}'", hs);
|
||||||
let kv = String::from(hs).into_kv();
|
let kv = String::from(hs).into_kv();
|
||||||
|
|
|
@ -48,7 +48,7 @@ pub fn verify(rt: &Runtime) {
|
||||||
};
|
};
|
||||||
|
|
||||||
info!("{: >6} | {: >14} | {:?}", verify, content_len, p.deref());
|
info!("{: >6} | {: >14} | {:?}", verify, content_len, p.deref());
|
||||||
let _ = rt.report_touched(fle.get_location()).unwrap_or_exit();
|
rt.report_touched(fle.get_location()).unwrap_or_exit();
|
||||||
status
|
status
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue