mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-23 05:35:20 +00:00
Reference instead of passing the vector
This commit is contained in:
parent
7e96651bbe
commit
35159b8393
|
@ -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..)
|
||||
|
|
|
@ -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::<Vec<_>>();
|
||||
|
||||
let prompt = ConfirmPrompt::new(cmd_names);
|
||||
let prompt = ConfirmPrompt::new(&cmd_names);
|
||||
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user