From d23425aa7527dd5c1df0cf5f5811839ed481c395 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Thu, 22 Aug 2024 22:19:47 -0500 Subject: [PATCH] fix compilation --- rust/src/include/primes.rs | 1 - rust/src/p0012.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rust/src/include/primes.rs b/rust/src/include/primes.rs index e921dd82..7237607f 100644 --- a/rust/src/include/primes.rs +++ b/rust/src/include/primes.rs @@ -4,7 +4,6 @@ use std::hash::Hash; use std::ops::{Add,Div,Mul,Rem}; use num_traits::{one,zero,One,Zero}; -use itertools::Itertools; pub struct Eratosthenes where I: Hash diff --git a/rust/src/p0012.rs b/rust/src/p0012.rs index 2f2304b1..06582731 100644 --- a/rust/src/p0012.rs +++ b/rust/src/p0012.rs @@ -27,14 +27,14 @@ We can see that 28 is the first triangle number to have over five divisors. What is the value of the first triangle number to have over five hundred divisors? */ -use crate::include::primes; +use crate::include::factors; use crate::include::utils::Answer; pub fn p0012() -> Answer { let mut num: u64 = 0; for x in 1.. { num += x; - if primes::proper_divisors(num).len() > 500 { + if factors::proper_divisors(num).collect::>().len() > 500 { return Answer::Int(num.into()); } }