diff --git a/rust/src/primes.rs b/rust/src/primes.rs index f67f44c4..46284e23 100644 --- a/rust/src/primes.rs +++ b/rust/src/primes.rs @@ -105,11 +105,11 @@ pub fn prime_factors(x: u64) -> PrimeFactors { pub fn proper_divisors(x: u64) -> Vec { let mut ret: Vec = vec![]; - let factors: Vec = PrimeFactors::new(x).collect().filter_map(Option::as_ref); + let factors: Vec = PrimeFactors::new(x).collect(); ret.extend(factors.clone()); for i in 2..(factors.len()) { for v in factors.iter().combinations(i) { - ret.push(v.iter().product()); + ret.push(v.into_iter().product()); } } ret.sort();