remove unneeded var

This commit is contained in:
Benjamin Rombaut authored and David Peter committed 2022-11-19 15:13:30 +01:00
1 parent a2e85a25b6
commit 781a6815c1
1 file changed
+2 -3
+2 -3
View File
@@ -221,9 +221,8 @@ impl<'a> Commands<'a> {
return Err(OptionsError::TooManyCommandNames(command_strings.len()).into());
}
let command_list = command_strings;
let mut commands = Vec::with_capacity(command_list.len());
for (i, s) in command_list.iter().enumerate() {
let mut commands = Vec::with_capacity(command_strings.len());
for (i, s) in command_strings.iter().enumerate() {
commands.push(Command::new(command_names.get(i).copied(), s));
}
Ok(Self(commands))