feat: use default value for invalid move argument

This commit is contained in:
darcy 2025-01-03 11:35:52 +11:00 committed by sxyazi
parent ab268a85df
commit 3f3b5004cd
No known key found for this signature in database

View file

@ -43,7 +43,7 @@ impl TryFrom<&Data> for OptStep {
impl From<CmdCow> for Opt {
fn from(c: CmdCow) -> Self {
Self {
step: c.get(0).unwrap().try_into().unwrap(),
step: c.get(0).unwrap().try_into().unwrap_or(OptStep::Offset(0)),
in_operating: c.bool("in-operating"),
}
}