From c2c1280f02b83a468da67d88350c199915427535 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 4 Nov 2022 21:01:17 +0900 Subject: Resolve a bunch of upcoming clippy lints --- helix-term/src/ui/menu.rs | 2 +- helix-term/src/ui/prompt.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs index 99c2473d..1baaf40a 100644 --- a/helix-term/src/ui/menu.rs +++ b/helix-term/src/ui/menu.rs @@ -40,7 +40,7 @@ impl Item for PathBuf { type Data = PathBuf; fn label(&self, root_path: &Self::Data) -> Spans { - self.strip_prefix(&root_path) + self.strip_prefix(root_path) .unwrap_or(self) .to_string_lossy() .into() diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index d0991d3c..ca2872a7 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -32,7 +32,7 @@ pub struct Prompt { next_char_handler: Option, } -#[derive(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq, Eq)] pub enum PromptEvent { /// The prompt input has been updated. Update, @@ -408,7 +408,7 @@ impl Prompt { surface.set_stringn( area.x + col * (1 + col_width), area.y + row, - &completion, + completion, col_width.saturating_sub(1) as usize, color, ); -- cgit v1.2.3-70-g09d2