option_parser: use an array directly to simplify code
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
a2438700e4
commit
61a5bae25c
1 changed files with 1 additions and 1 deletions
|
|
@ -205,7 +205,7 @@ impl FromStr for ByteSized {
|
|||
0
|
||||
};
|
||||
|
||||
let s = s.trim_end_matches(|c| c == 'K' || c == 'M' || c == 'G');
|
||||
let s = s.trim_end_matches(['K', 'M', 'G']);
|
||||
s.parse::<u64>()
|
||||
.map_err(|_| ByteSizedParseError::InvalidValue(s.to_owned()))?
|
||||
<< shift
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue