diff --git a/tui/src/confirmation.rs b/tui/src/confirmation.rs index 64b160e0..1993c3f5 100644 --- a/tui/src/confirmation.rs +++ b/tui/src/confirmation.rs @@ -21,7 +21,7 @@ pub struct ConfirmPrompt { } impl ConfirmPrompt { - pub fn new(names: Vec<&str>) -> Self { + pub fn new(names: &[&str]) -> Self { let names = names .iter() .zip(1..) diff --git a/tui/src/state.rs b/tui/src/state.rs index ed320a2d..396123a9 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -137,7 +137,7 @@ impl AppState { .map(|node| node.name.as_str()) .collect(); - let prompt = ConfirmPrompt::new(cmd_names); + let prompt = ConfirmPrompt::new(&cmd_names); self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40)); } } @@ -798,7 +798,7 @@ impl AppState { .map(|node| node.name.as_str()) .collect::>(); - let prompt = ConfirmPrompt::new(cmd_names); + let prompt = ConfirmPrompt::new(&cmd_names); self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40)); } }