feat: fix clippy
This commit is contained in:
@@ -310,13 +310,13 @@ fn select_envelop<'a>(meta: &'a TinyEncryptMeta, config: &Option<TinyEncryptConf
|
||||
success!("Found {} envelops:", envelops.len());
|
||||
if envelops.len() == 1 {
|
||||
let selected_envelop = &envelops[0];
|
||||
success!("Auto selected envelop: #{} {}", 1, util_envelop::format_envelop(selected_envelop, &config));
|
||||
success!("Auto selected envelop: #{} {}", 1, util_envelop::format_envelop(selected_envelop, config));
|
||||
util::read_line("Press enter to continue: ");
|
||||
return Ok(selected_envelop);
|
||||
}
|
||||
|
||||
envelops.iter().enumerate().for_each(|(i, envelop)| {
|
||||
println!("#{} {}", i + 1, util_envelop::format_envelop(envelop, &config));
|
||||
println!("#{} {}", i + 1, util_envelop::format_envelop(envelop, config));
|
||||
});
|
||||
|
||||
let envelop_number = util::read_number("Please select an envelop:", 1, envelops.len());
|
||||
|
||||
@@ -92,7 +92,7 @@ impl TinyEncryptConfig {
|
||||
|
||||
pub fn find_by_kid_or_type(&self, k_filter: &str) -> Vec<&TinyEncryptConfigEnvelop> {
|
||||
self.find_by_kid_or_filter(k_filter, |e| {
|
||||
k_filter == "ALL" || k_filter == &format!("type:{}", &e.r#type.get_name())
|
||||
k_filter == "ALL" || k_filter == format!("type:{}", &e.r#type.get_name())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ impl TinyEncryptConfig {
|
||||
}
|
||||
}
|
||||
if let Some(key_filter) = key_filter {
|
||||
key_filter.split(",").for_each(|k| {
|
||||
key_filter.split(',').for_each(|k| {
|
||||
let k = k.trim();
|
||||
if !k.is_empty() {
|
||||
key_ids.push(k.to_string());
|
||||
|
||||
Reference in New Issue
Block a user