option_parser: fix clippy warnings

Signed-off-by: Praveen Paladugu <prapal@microsoft.com>
This commit is contained in:
Praveen Paladugu 2020-09-23 20:31:53 +00:00 committed by Rob Bradford
parent c54452c08a
commit 6ebeaa9246

View File

@ -189,7 +189,7 @@ impl FromStr for IntegerList {
let items: Vec<&str> = range.split('-').collect(); let items: Vec<&str> = range.split('-').collect();
if items.len() > 2 { if items.len() > 2 {
return Err(IntegerListParseError::InvalidValue(range.to_string())); return Err(IntegerListParseError::InvalidValue((*range).to_string()));
} }
let start_range = items[0] let start_range = items[0]
@ -203,7 +203,7 @@ impl FromStr for IntegerList {
.parse::<u64>() .parse::<u64>()
.map_err(|_| IntegerListParseError::InvalidValue(items[1].to_owned()))?; .map_err(|_| IntegerListParseError::InvalidValue(items[1].to_owned()))?;
if start_range >= end_range { if start_range >= end_range {
return Err(IntegerListParseError::InvalidValue(range.to_string())); return Err(IntegerListParseError::InvalidValue((*range).to_string()));
} }
for i in start_range..end_range { for i in start_range..end_range {
@ -233,7 +233,9 @@ impl FromStr for TupleTwoIntegers {
let items: Vec<&str> = tuple.split('@').collect(); let items: Vec<&str> = tuple.split('@').collect();
if items.len() != 2 { if items.len() != 2 {
return Err(TupleTwoIntegersParseError::InvalidValue(tuple.to_string())); return Err(TupleTwoIntegersParseError::InvalidValue(
(*tuple).to_string(),
));
} }
let item1 = items[0] let item1 = items[0]