Tweak parse_opt_uint
.
Don't set `slot` on failure, like all the other `parse_*` functions.
This commit is contained in:
parent
7ec7b572a9
commit
3093018474
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user