From 7f1a94066cd23c2a40cb3dc8bb2425f331946b0a Mon Sep 17 00:00:00 2001 From: cossonleo Date: Fri, 29 Oct 2021 14:26:17 +0800 Subject: [PATCH] fix clippy --- helix-term/src/commands.rs | 2 +- helix-term/src/ui/prompt.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); }