diff --git a/src/completer.rs b/src/completer.rs index 4d864ba..000e6ee 100644 --- a/src/completer.rs +++ b/src/completer.rs @@ -83,12 +83,7 @@ impl ClickHelper { #[allow(clippy::borrowed_box)] fn get_exact_command(&self, line: &str) -> Option<&Box> { - for cmd in self.commands.iter() { - if cmd.is(line) { - return Some(cmd); - } - } - None + self.commands.iter().find(|&cmd| cmd.is(line)) } /// complete a line that starts with a full command. This should only be called when we know diff --git a/src/table.rs b/src/table.rs index cd168b0..8146ba8 100644 --- a/src/table.rs +++ b/src/table.rs @@ -379,7 +379,7 @@ pub fn raw_quantity(quantity: &Quantity) -> f64 { if suffix.len() > 1 && (suffix.starts_with('e') || suffix.starts_with('E')) { // our suffix has more than one char and starts with e/E, so it should be a decimal exponent - match (&suffix[1..]).parse::() { + match (suffix[1..]).parse::() { Ok(exp) => { let famt = (amt * base10.pow(exp)) as f64; if has_neg {