mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
fix clippy warnings
This commit is contained in:
@@ -163,6 +163,7 @@ pub fn factor(mut n: u64) -> Factors {
|
||||
|
||||
let (factors, n) = table::factor(n, factors);
|
||||
|
||||
#[allow(clippy::let_and_return)]
|
||||
let r = if n < (1 << 32) {
|
||||
_factor::<Montgomery<u32>>(n, factors)
|
||||
} else {
|
||||
@@ -280,6 +281,6 @@ impl std::ops::BitXor<Exponent> for Factors {
|
||||
}
|
||||
|
||||
debug_assert_eq!(r.product(), self.product().pow(rhs.into()));
|
||||
return r;
|
||||
r
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1413,11 +1413,11 @@ fn get_block_size(md: &Metadata, config: &Config) -> u64 {
|
||||
{
|
||||
// hard-coded for now - enabling setting this remains a TODO
|
||||
let ls_block_size = 1024;
|
||||
return match config.size_format {
|
||||
match config.size_format {
|
||||
SizeFormat::Binary => md.blocks() * 512,
|
||||
SizeFormat::Decimal => md.blocks() * 512,
|
||||
SizeFormat::Bytes => md.blocks() * 512 / ls_block_size,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(unix))]
|
||||
|
||||
@@ -121,6 +121,8 @@ impl Parser {
|
||||
/// Test if the next token in the stream is a BOOLOP (-a or -o), without
|
||||
/// removing the token from the stream.
|
||||
fn peek_is_boolop(&mut self) -> bool {
|
||||
// TODO: change to `matches!(self.peek(), Symbol::BoolOp(_))` once MSRV is 1.42
|
||||
// #[allow(clippy::match_like_matches_macro)] // needs MSRV 1.43
|
||||
if let Symbol::BoolOp(_) = self.peek() {
|
||||
true
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user