clippy: re-enable unnecessary_semicolon lint

This commit is contained in:
Daniel Hofstetter
2025-11-04 23:47:45 +01:00
committed by Dorian Péron
parent e84b261ff1
commit c5554ab9cb
12 changed files with 14 additions and 15 deletions
-1
View File
@@ -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"
+1 -1
View File
@@ -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 != "-" {
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -192,7 +192,7 @@ impl<C: FormatChar> FormatItem<C> {
match self {
Self::Spec(spec) => spec.write(writer, args)?,
Self::Char(c) => return c.write(writer).map_err(FormatError::IoError),
};
}
Ok(ControlFlow::Continue(()))
}
}
@@ -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);
+1 -1
View File
@@ -398,7 +398,7 @@ impl Spec {
// TODO: This should break the _entire execution_ of printf
break;
}
};
}
}
writer.write_all(&parsed).map_err(FormatError::IoError)
}
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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
+2 -2
View File
@@ -125,7 +125,7 @@ pub fn wrap_chown<P: AsRef<Path>>(
entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string())
)
};
};
}
}
}
return Err(out);
@@ -157,7 +157,7 @@ pub fn wrap_chown<P: AsRef<Path>>(
};
}
_ => (),
};
}
} else if verbosity.level == VerbosityLevel::Verbose {
out = if verbosity.groups_only {
format!(
+1 -1
View File
@@ -81,7 +81,7 @@ pub fn format_system_time<W: Write>(
}
out.write_fmt(format_args!("{secs}.{nsecs:09}"))?;
}
};
}
Ok(())
}
}
+1 -1
View File
@@ -65,7 +65,7 @@ impl TryFrom<PathBuf> for Teletype {
.parse::<u64>()
.map_err(|_| ())
.map(Teletype::Pts);
};
}
// Considering this format: **/**/ttyS** then **/**/tty**
let path = value.to_str().ok_or(())?;