diff --git a/option_parser/src/lib.rs b/option_parser/src/lib.rs index 5a8399a94..97c7ceb5a 100644 --- a/option_parser/src/lib.rs +++ b/option_parser/src/lib.rs @@ -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::() .map_err(|_| ByteSizedParseError::InvalidValue(s.to_owned()))? << shift