1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 21:47:46 +00:00

refactor/polish ~ fix cargo clippy complaints (wildcard_in_or_patt)

This commit is contained in:
Roy Ivy III 2020-04-03 16:45:10 -05:00
parent 5224c3cd49
commit 0cf704a1bf
4 changed files with 6 additions and 5 deletions

View file

@ -623,7 +623,7 @@ fn display_file_name(
Some(val) => match val.as_ref() { Some(val) => match val.as_ref() {
"always" | "yes" | "force" => true, "always" | "yes" | "force" => true,
"auto" | "tty" | "if-tty" => stdout_isatty(), "auto" | "tty" | "if-tty" => stdout_isatty(),
"never" | "no" | "none" | _ => false, /* "never" | "no" | "none" | */ _ => false,
}, },
}; };
let classify = options.opt_present("classify"); let classify = options.opt_present("classify");

View file

@ -128,7 +128,7 @@ impl Intf {
}, },
'x' | 'X' => "ffffffffffffffff", 'x' | 'X' => "ffffffffffffffff",
'o' => "1777777777777777777777", 'o' => "1777777777777777777777",
'u' | _ => "18446744073709551615", /* 'u' | */ _ => "18446744073709551615",
})); }));
fmt_prim fmt_prim
} }
@ -204,7 +204,7 @@ impl Formatter for Intf {
let radix_out = match *field.field_char { let radix_out = match *field.field_char {
'd' | 'i' | 'u' => Base::Ten, 'd' | 'i' | 'u' => Base::Ten,
'x' | 'X' => Base::Hex, 'x' | 'X' => Base::Hex,
'o' | _ => Base::Octal, /* 'o' | */ _ => Base::Octal,
}; };
let radix_mismatch = !radix_out.eq(&inprefix.radix_in); let radix_mismatch = !radix_out.eq(&inprefix.radix_in);
let decr_from_max: bool = inprefix.sign == -1 && *field.field_char != 'i'; let decr_from_max: bool = inprefix.sign == -1 && *field.field_char != 'i';

View file

@ -369,7 +369,8 @@ impl token::Token for Sub {
// for 'c': get iter of string vals, // for 'c': get iter of string vals,
// get opt<char> of first val // get opt<char> of first val
// and map it to opt<String> // and map it to opt<String>
'c' | _ => arg_string.chars().next().map(|x| x.to_string()), /* 'c' | */
_ => arg_string.chars().next().map(|x| x.to_string()),
} }
} }
None => None, None => None,

View file

@ -148,7 +148,7 @@ impl UnescapedText {
'u' | 'U' => { 'u' | 'U' => {
let len = match e { let len = match e {
'u' => 4, 'u' => 4,
'U' | _ => 8, /* 'U' | */ _ => 8,
}; };
let val = UnescapedText::base_to_u32(len, len, 16, it); let val = UnescapedText::base_to_u32(len, len, 16, it);
UnescapedText::validate_iec(val, false); UnescapedText::validate_iec(val, false);