Tweak parse_opt_uint.

Don't set `slot` on failure, like all the other `parse_*` functions.
This commit is contained in:
Nicholas Nethercote 2020-04-03 14:02:44 +11:00
parent 7ec7b572a9
commit 3093018474

View File

@ -421,7 +421,7 @@ fn parse_uint(slot: &mut usize, v: Option<&str>) -> bool {
fn parse_opt_uint(slot: &mut Option<usize>, v: Option<&str>) -> bool {
match v {
Some(s) => { *slot = s.parse().ok(); slot.is_some() }
None => { *slot = None; false }
None => false
}
}