Skip to content

Commit

Permalink
Formatted and fixed lints
Browse files Browse the repository at this point in the history
  • Loading branch information
tfpf committed Sep 21, 2024
1 parent c5c7501 commit bb65f5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions benches/benches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ pub fn sieve_of_atkin(c: &mut criterion::Criterion) {
}

pub fn primes(c: &mut criterion::Criterion) {
c.bench_function("primes", |b| {
b.iter(|| utils::Primes::new(10i64.pow(6)).count())
});
c.bench_function("primes", |b| b.iter(|| utils::Primes::new(10i64.pow(6)).count()));
}

criterion::criterion_group!(benches, is_prime, sieve_of_atkin, primes);
Expand Down
4 changes: 1 addition & 3 deletions src/utils/iterators/primes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ impl Primes {

fn next_other_prime(&mut self) -> Option<i64> {
loop {
let Some(potential_prime) = self.potential_primes.next() else {
return None;
};
let potential_prime = self.potential_primes.next()?;
match self.lookup.remove(&potential_prime) {
None => {
self.lookup.insert(potential_prime.pow(2), potential_prime);
Expand Down

0 comments on commit bb65f5e

Please sign in to comment.