From 81243db94809422c8e1635a719e58a638ca3c9da Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Tue, 6 Dec 2022 10:50:34 +0100 Subject: [PATCH] chore: fix wildcards that match single variant --- src/uu/dircolors/src/dircolors.rs | 4 ++-- src/uu/hashsum/src/hashsum.rs | 4 ++-- src/uu/shred/src/shred.rs | 2 +- src/uucore/src/lib/features/fs.rs | 2 +- src/uucore/src/lib/mods/quoting_style.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/uu/dircolors/src/dircolors.rs b/src/uu/dircolors/src/dircolors.rs index 86beb9e90..54e0db395 100644 --- a/src/uu/dircolors/src/dircolors.rs +++ b/src/uu/dircolors/src/dircolors.rs @@ -287,7 +287,7 @@ where OutputFmt::Shell => result.push_str("LS_COLORS='"), OutputFmt::CShell => result.push_str("setenv LS_COLORS '"), OutputFmt::Display => (), - _ => unreachable!(), + OutputFmt::Unknown => unreachable!(), } let mut table: HashMap<&str, &str> = HashMap::with_capacity(48); @@ -405,7 +405,7 @@ where // remove latest "\n" result.pop(); } - _ => unreachable!(), + OutputFmt::Unknown => unreachable!(), } Ok(result) diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index 9e6fc1dc5..5e0973a16 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -634,7 +634,7 @@ where match bad_format.cmp(&1) { Ordering::Equal => show_warning!("{} line is improperly formatted", bad_format), Ordering::Greater => show_warning!("{} lines are improperly formatted", bad_format), - _ => {} + Ordering::Less => {} }; if failed_cksum > 0 { show_warning!("{} computed checksum did NOT match", failed_cksum); @@ -644,7 +644,7 @@ where Ordering::Greater => { show_warning!("{} listed files could not be read", failed_open_file); } - _ => {} + Ordering::Less => {} } } diff --git a/src/uu/shred/src/shred.rs b/src/uu/shred/src/shred.rs index e0ddc099e..de1af9e30 100644 --- a/src/uu/shred/src/shred.rs +++ b/src/uu/shred/src/shred.rs @@ -126,7 +126,7 @@ impl<'a> BytesGenerator<'a> { fn new(total_bytes: u64, gen_type: PassType<'a>, exact: bool) -> BytesGenerator { let rng = match gen_type { PassType::Random => Some(RefCell::new(rand::thread_rng())), - _ => None, + PassType::Pattern(_) => None, }; let bytes = [0; BLOCK_SIZE]; diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index 8f7c13d20..24be78c06 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -396,7 +396,7 @@ pub fn canonicalize>( read_dir(parent)?; } } - _ => {} + MissingHandling::Missing => {} } Ok(result) } diff --git a/src/uucore/src/lib/mods/quoting_style.rs b/src/uucore/src/lib/mods/quoting_style.rs index 38401a169..b07154139 100644 --- a/src/uucore/src/lib/mods/quoting_style.rs +++ b/src/uucore/src/lib/mods/quoting_style.rs @@ -278,7 +278,7 @@ pub fn escape_name(name: &OsStr, style: &QuotingStyle) -> String { match quotes { Quotes::Single => format!("'{}'", escaped_str), Quotes::Double => format!("\"{}\"", escaped_str), - _ => escaped_str, + Quotes::None => escaped_str, } } QuotingStyle::Shell {