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:
Hofer-Julian
2023-01-24 12:23:42 +01:00
committed by GitHub
parent 0bb2e47c98
commit 41306aa7e0
49 changed files with 467 additions and 634 deletions

View File

@ -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)
}
}
}
}