diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index c1e1ecceb01b5..f467377373e0c 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1186,7 +1186,7 @@ fn search_completions(cx: &mut Context, reg: Option) -> Vec { } }) .take(10) - .map(|item| item.clone()) + .cloned() .collect() }) } diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 1956dec288b0b..c999ba1402094 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -493,7 +493,7 @@ impl Component for Prompt { 1, ); let line = text.slice(range.from()..range.to()).to_string(); - if line.len() > 0 { + if !line.is_empty() { self.insert_str(line.as_str()); (self.callback_fn)(cx, &self.line, PromptEvent::Update); }