mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-23 13:45:19 +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 {
|
impl ConfirmPrompt {
|
||||||
pub fn new(names: Vec<&str>) -> Self {
|
pub fn new(names: &[&str]) -> Self {
|
||||||
let names = names
|
let names = names
|
||||||
.iter()
|
.iter()
|
||||||
.zip(1..)
|
.zip(1..)
|
||||||
|
|
|
@ -137,7 +137,7 @@ impl AppState {
|
||||||
.map(|node| node.name.as_str())
|
.map(|node| node.name.as_str())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let prompt = ConfirmPrompt::new(cmd_names);
|
let prompt = ConfirmPrompt::new(&cmd_names);
|
||||||
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -798,7 +798,7 @@ impl AppState {
|
||||||
.map(|node| node.name.as_str())
|
.map(|node| node.name.as_str())
|
||||||
.collect::<Vec<_>>();
|
.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));
|
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user