1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #2200 from jhscheer/fix_clippy

fix clippy warnings
This commit is contained in:
Sylvestre Ledru 2021-05-10 16:13:27 +02:00 committed by GitHub
commit ed42652803
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -163,6 +163,7 @@ pub fn factor(mut n: u64) -> Factors {
let (factors, n) = table::factor(n, factors); let (factors, n) = table::factor(n, factors);
#[allow(clippy::let_and_return)]
let r = if n < (1 << 32) { let r = if n < (1 << 32) {
_factor::<Montgomery<u32>>(n, factors) _factor::<Montgomery<u32>>(n, factors)
} else { } else {
@ -280,6 +281,6 @@ impl std::ops::BitXor<Exponent> for Factors {
} }
debug_assert_eq!(r.product(), self.product().pow(rhs.into())); debug_assert_eq!(r.product(), self.product().pow(rhs.into()));
return r; r
} }
} }

View file

@ -1413,11 +1413,11 @@ fn get_block_size(md: &Metadata, config: &Config) -> u64 {
{ {
// hard-coded for now - enabling setting this remains a TODO // hard-coded for now - enabling setting this remains a TODO
let ls_block_size = 1024; let ls_block_size = 1024;
return match config.size_format { match config.size_format {
SizeFormat::Binary => md.blocks() * 512, SizeFormat::Binary => md.blocks() * 512,
SizeFormat::Decimal => md.blocks() * 512, SizeFormat::Decimal => md.blocks() * 512,
SizeFormat::Bytes => md.blocks() * 512 / ls_block_size, SizeFormat::Bytes => md.blocks() * 512 / ls_block_size,
}; }
} }
#[cfg(not(unix))] #[cfg(not(unix))]

View file

@ -121,6 +121,8 @@ impl Parser {
/// Test if the next token in the stream is a BOOLOP (-a or -o), without /// Test if the next token in the stream is a BOOLOP (-a or -o), without
/// removing the token from the stream. /// removing the token from the stream.
fn peek_is_boolop(&mut self) -> bool { 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() { if let Symbol::BoolOp(_) = self.peek() {
true true
} else { } else {