From 25050171b64632d7bcdb3d6a15c2e2f34cb47173 Mon Sep 17 00:00:00 2001 From: Nathanael DEMACON Date: Sat, 29 Jun 2024 16:59:49 +0200 Subject: [PATCH] refactor: fix lint issues Signed-off-by: Nathanael DEMACON --- src/main.rs | 2 +- src/searchable.rs | 2 +- src/ui.rs | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5acba1b..5e6e2f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ struct Args { )] config: Vec, - /// Shows ProxyCommand + /// Shows `ProxyCommand` #[arg(long, default_value_t = false)] show_proxy_command: bool, diff --git a/src/searchable.rs b/src/searchable.rs index cdb2347..a0d8753 100644 --- a/src/searchable.rs +++ b/src/searchable.rs @@ -31,7 +31,7 @@ where pub fn search(&mut self, value: &str) { if value.is_empty() { - self.filtered = self.vec.clone(); + self.filtered.clone_from(&self.vec); return; } diff --git a/src/ui.rs b/src/ui.rs index 1115dd6..32fb073 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -132,9 +132,9 @@ impl App { Ok(()) } - fn run(&mut self, terminal: &Rc>>) -> Result<()> + fn run(&mut self, terminal: &Rc>>) -> Result<()> where - B: std::io::Write, + B: Backend + std::io::Write, { loop { terminal.borrow_mut().draw(|f| ui(f, self))?; @@ -319,9 +319,9 @@ impl App { } } -fn setup_terminal(terminal: &Rc>>) -> Result<()> +fn setup_terminal(terminal: &Rc>>) -> Result<()> where - B: std::io::Write, + B: Backend + std::io::Write, { let mut terminal = terminal.borrow_mut(); @@ -337,9 +337,9 @@ where Ok(()) } -fn restore_terminal(terminal: &Rc>>) -> Result<()> +fn restore_terminal(terminal: &Rc>>) -> Result<()> where - B: std::io::Write, + B: Backend + std::io::Write, { let mut terminal = terminal.borrow_mut(); terminal.clear()?;