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()?;