Use first() instead of get(0)

This commit is contained in:
sxyazi 2025-01-04 10:34:29 +08:00
parent 74adbaca73
commit 8e9eed408c
No known key found for this signature in database

View file

@ -14,7 +14,7 @@ struct Opt {
impl From<CmdCow> for Opt {
fn from(c: CmdCow) -> Self {
Self {
step: c.get(0).and_then(|d| d.try_into().ok()).unwrap_or_default(),
step: c.first().and_then(|d| d.try_into().ok()).unwrap_or_default(),
in_operating: c.bool("in-operating"),
}
}