From dcc22188ba54d125cb3e824acc35512de26bc873 Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 1 Jul 2020 00:21:18 +0200 Subject: [PATCH] factor: Fix clippy warnings --- src/uu/factor/src/factor.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/uu/factor/src/factor.rs b/src/uu/factor/src/factor.rs index bcf570972..c0b6ea964 100644 --- a/src/uu/factor/src/factor.rs +++ b/src/uu/factor/src/factor.rs @@ -22,12 +22,6 @@ impl Factors { Factors { f: BTreeMap::new() } } - pub fn prime(p: u64) -> Factors { - let mut f = Factors::one(); - f.push(p); - f - } - pub fn add(&mut self, prime: u64, exp: u8) { debug_assert!(miller_rabin::is_prime(prime)); debug_assert!(exp > 0); @@ -107,11 +101,8 @@ pub fn factor(mut n: u64) -> Factors { let (factors, n) = table::factor(n, factors); - if n < (1 << 32) { - _factor::(n, factors) - } else { - _factor::(n, factors) - } + // TODO: Optimise with 32 and 64b versions + _factor::(n, factors) } #[cfg(test)]