From e04bb8b8915bfe1df1a5ee7a8750f2589f2aae06 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 19 May 2022 22:16:11 -0500 Subject: [PATCH] address rust 1.61.0 clippy lints (#2514) --- helix-term/src/commands.rs | 4 ++-- helix-term/src/ui/picker.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 855f2d7d..c3c7d224 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1225,11 +1225,11 @@ fn replace(cx: &mut Context) { // need to wait for next key cx.on_next_key(move |cx, event| { let (view, doc) = current!(cx.editor); - let ch = match event { + let ch: Option<&str> = match event { KeyEvent { code: KeyCode::Char(ch), .. - } => Some(&ch.encode_utf8(&mut buf[..])[..]), + } => Some(ch.encode_utf8(&mut buf[..])), KeyEvent { code: KeyCode::Enter, .. diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 3ca6965c..49d91be6 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -366,6 +366,7 @@ impl Picker { ); } else if pattern.starts_with(&self.previous_pattern) { // TODO: remove when retain_mut is in stable rust + #[allow(unused_imports)] use retain_mut::RetainMut; // optimization: if the pattern is a more specific version of the previous one