[F] Fix #460: Hyfetch panics upon entering invalid alignment option after roll
This commit is contained in:
parent
2dc18050ca
commit
9b376f97c0
1 changed files with 13 additions and 10 deletions
|
|
@ -938,16 +938,19 @@ fn create_config(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save choice
|
// Save choice
|
||||||
color_align = arrangements
|
color_align = if choice == "horizontal" { ColorAlignment::Horizontal }
|
||||||
.into_iter()
|
else if choice == "vertical" { ColorAlignment::Vertical }
|
||||||
.find_map(|(k, ca)| {
|
else {
|
||||||
if k.to_lowercase() == choice {
|
arrangements.into_iter()
|
||||||
Some(ca)
|
.find_map(|(k, ca)| {
|
||||||
} else {
|
if k.to_lowercase() == choice {
|
||||||
None
|
Some(ca)
|
||||||
}
|
} else {
|
||||||
})
|
None
|
||||||
.expect("selected color alignment should be valid");
|
}
|
||||||
|
})
|
||||||
|
.expect("selected color alignment is not valid") // TODO: it sould ask the user to retry instead of panicking
|
||||||
|
};
|
||||||
debug!(?color_align, "selected color alignment");
|
debug!(?color_align, "selected color alignment");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue