Skip to content

Commit

Permalink
Reference instead of passing the vector
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Nov 11, 2024
1 parent 7e96651 commit 35159b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tui/src/confirmation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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..)
Expand Down
4 changes: 2 additions & 2 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down Expand Up @@ -798,7 +798,7 @@ impl AppState {
.map(|node| node.name.as_str())
.collect::<Vec<_>>();

let prompt = ConfirmPrompt::new(cmd_names);
let prompt = ConfirmPrompt::new(&cmd_names);
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
}
}
Expand Down

0 comments on commit 35159b8

Please sign in to comment.