parent
7f8e80c645
commit
40e49bffe4
1 changed files with 3 additions and 1 deletions
|
@ -221,7 +221,9 @@ pub fn vault_by_index_or_name<'a>(
|
||||||
let parsed_index = index_or_name.parse::<usize>();
|
let parsed_index = index_or_name.parse::<usize>();
|
||||||
|
|
||||||
let Some((index, vault)) = (if let Ok(index) = parsed_index {
|
let Some((index, vault)) = (if let Ok(index) = parsed_index {
|
||||||
vaults.get_mut(index - 1).map(|v| (index, v))
|
index
|
||||||
|
.checked_sub(1)
|
||||||
|
.and_then(|zeroindex| vaults.get_mut(zeroindex).map(|v| (index, v)))
|
||||||
} else {
|
} else {
|
||||||
vaults
|
vaults
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
|
|
Loading…
Reference in a new issue