mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 06:05:27 +02:00
Reduce again the number of match calls (#7815)
- Reduce the number of match calls (see commit messages) - A few miscellaneous improvements
This commit is contained in:
@ -43,10 +43,13 @@ impl Inc {
|
||||
|
||||
Value::string(ver.to_string(), head)
|
||||
}
|
||||
Some(Action::Default) | None => match input.parse::<u64>() {
|
||||
Ok(v) => Value::string((v + 1).to_string(), head),
|
||||
Err(_) => Value::string(input, head),
|
||||
},
|
||||
Some(Action::Default) | None => {
|
||||
if let Ok(v) = input.parse::<u64>() {
|
||||
Value::string((v + 1).to_string(), head)
|
||||
} else {
|
||||
Value::string(input, head)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user