diff --git a/Cargo.toml b/Cargo.toml index 7eb8aa48953..3907137bcbc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -675,7 +675,6 @@ enum_glob_use = "allow" ptr_cast_constness = "allow" borrow_as_ptr = "allow" ptr_as_ptr = "allow" -unnecessary_semicolon = "allow" needless_raw_string_hashes = "allow" unreadable_literal = "allow" unnested_or_patterns = "allow" diff --git a/src/uu/cksum/src/cksum.rs b/src/uu/cksum/src/cksum.rs index 2ddfc2dc790..c7a3e969b4d 100644 --- a/src/uu/cksum/src/cksum.rs +++ b/src/uu/cksum/src/cksum.rs @@ -130,7 +130,7 @@ fn print_legacy_checksum( print!("{sum} {size}"); } _ => unreachable!("Not a legacy algorithm"), - }; + } // Print the filename after a space if not stdin if filename != "-" { diff --git a/src/uu/seq/src/numberparse.rs b/src/uu/seq/src/numberparse.rs index 40c427aaf23..ba4ab4e4eba 100644 --- a/src/uu/seq/src/numberparse.rs +++ b/src/uu/seq/src/numberparse.rs @@ -76,7 +76,7 @@ fn compute_num_digits(input: &str, ebd: ExtendedBigDecimal) -> PreciseNumber { // Also ignore overflowed exponents (unwrap_or(0)). if exp > 0 { int_digits += exp.try_into().unwrap_or(0); - }; + } frac_digits = if exp < frac_digits as i64 { // Subtract from i128 to avoid any overflow (frac_digits as i128 - exp as i128).try_into().unwrap_or(0) diff --git a/src/uucore/src/lib/features/checksum.rs b/src/uucore/src/lib/features/checksum.rs index 5e1ffe7203d..324dba7b3f8 100644 --- a/src/uucore/src/lib/features/checksum.rs +++ b/src/uucore/src/lib/features/checksum.rs @@ -1125,7 +1125,7 @@ fn process_checksum_file( Err(CantOpenFile | FileIsDirectory) => res.failed_open_file += 1, Err(FileNotFound) if !opts.ignore_missing => res.failed_open_file += 1, _ => (), - }; + } } // not a single line correctly formatted found diff --git a/src/uucore/src/lib/features/format/mod.rs b/src/uucore/src/lib/features/format/mod.rs index 54ce9690d5c..2863407a085 100644 --- a/src/uucore/src/lib/features/format/mod.rs +++ b/src/uucore/src/lib/features/format/mod.rs @@ -192,7 +192,7 @@ impl FormatItem { match self { Self::Spec(spec) => spec.write(writer, args)?, Self::Char(c) => return c.write(writer).map_err(FormatError::IoError), - }; + } Ok(ControlFlow::Continue(())) } } diff --git a/src/uucore/src/lib/features/format/num_format.rs b/src/uucore/src/lib/features/format/num_format.rs index 6b17fe2fbad..1fa07977eec 100644 --- a/src/uucore/src/lib/features/format/num_format.rs +++ b/src/uucore/src/lib/features/format/num_format.rs @@ -276,7 +276,7 @@ impl Formatter<&ExtendedBigDecimal> for Float { // Pad non-finite numbers with spaces, not zeros. if alignment == NumberAlignment::RightZero { alignment = NumberAlignment::RightSpace; - }; + } format_float_non_finite(&abs, self.case) } }; @@ -519,7 +519,7 @@ fn format_float_shortest( output.push_str(first_digits); output.push('.'); output.push_str(remaining_digits); - }; + } if force_decimal == ForceDecimal::No { strip_fractional_zeroes_and_dot(&mut output); @@ -636,7 +636,7 @@ fn format_float_hexadecimal( } } else { frac2 <<= wanted_bits - bits; - }; + } // Convert "XXX" to "X.XX": that divides by 16^precision = 2^(4*precision), so add that to the exponent. let mut digits = frac2.to_str_radix(16); diff --git a/src/uucore/src/lib/features/format/spec.rs b/src/uucore/src/lib/features/format/spec.rs index 138e28740f0..467f0985059 100644 --- a/src/uucore/src/lib/features/format/spec.rs +++ b/src/uucore/src/lib/features/format/spec.rs @@ -398,7 +398,7 @@ impl Spec { // TODO: This should break the _entire execution_ of printf break; } - }; + } } writer.write_all(&parsed).map_err(FormatError::IoError) } diff --git a/src/uucore/src/lib/features/fsext.rs b/src/uucore/src/lib/features/fsext.rs index 6d851f1fe6f..4be4d66cf8f 100644 --- a/src/uucore/src/lib/features/fsext.rs +++ b/src/uucore/src/lib/features/fsext.rs @@ -243,7 +243,7 @@ impl MountInfo { mount_option = String::from_utf8_lossy(raw[3]).to_string(); } _ => return None, - }; + } let dev_id = mount_dev_id(&mount_dir); let dummy = is_dummy_filesystem(&fs_type, &mount_option); diff --git a/src/uucore/src/lib/features/mode.rs b/src/uucore/src/lib/features/mode.rs index 7befc1a6785..50ed8c97c0c 100644 --- a/src/uucore/src/lib/features/mode.rs +++ b/src/uucore/src/lib/features/mode.rs @@ -119,7 +119,7 @@ fn parse_change(mode: &str, fperm: u32, considering_dir: bool) -> (u32, usize) { 'g' => srwx = ((fperm << 3) & 0o700) | (fperm & 0o070) | ((fperm >> 3) & 0o007), 'o' => srwx = ((fperm << 6) & 0o700) | ((fperm << 3) & 0o070) | (fperm & 0o007), _ => break, - }; + } if ch == 'u' || ch == 'g' || ch == 'o' { // symbolic modes only allows perms to be a single letter of 'ugo' // therefore this must either be the first char or it is unexpected diff --git a/src/uucore/src/lib/features/perms.rs b/src/uucore/src/lib/features/perms.rs index a67c27e36b7..f6a73cc965b 100644 --- a/src/uucore/src/lib/features/perms.rs +++ b/src/uucore/src/lib/features/perms.rs @@ -125,7 +125,7 @@ pub fn wrap_chown>( entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string()) ) }; - }; + } } } return Err(out); @@ -157,7 +157,7 @@ pub fn wrap_chown>( }; } _ => (), - }; + } } else if verbosity.level == VerbosityLevel::Verbose { out = if verbosity.groups_only { format!( diff --git a/src/uucore/src/lib/features/time.rs b/src/uucore/src/lib/features/time.rs index b64d250c1aa..d6f44434f78 100644 --- a/src/uucore/src/lib/features/time.rs +++ b/src/uucore/src/lib/features/time.rs @@ -81,7 +81,7 @@ pub fn format_system_time( } out.write_fmt(format_args!("{secs}.{nsecs:09}"))?; } - }; + } Ok(()) } } diff --git a/src/uucore/src/lib/features/tty.rs b/src/uucore/src/lib/features/tty.rs index 221ee442d63..c25b5f2e0c1 100644 --- a/src/uucore/src/lib/features/tty.rs +++ b/src/uucore/src/lib/features/tty.rs @@ -65,7 +65,7 @@ impl TryFrom for Teletype { .parse::() .map_err(|_| ()) .map(Teletype::Pts); - }; + } // Considering this format: **/**/ttyS** then **/**/tty** let path = value.to_str().ok_or(())?;