From 61a5bae25c91ebb5572199d299e85da3d2f659d1 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 23 Jul 2024 19:18:27 +0000 Subject: [PATCH] option_parser: use an array directly to simplify code Signed-off-by: Wei Liu --- option_parser/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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