Skip to content

Commit

Permalink
Small tweaks to get coverage up
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 25, 2024
1 parent 07dc8fe commit 62d10ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const ANSWERS: [ProblemRef; 17] = [
("p0357", p0357::p0357, 1739023853137),
];

#[cfg(not(test))]
fn main() {
let sieve = primes::primes::<u64>().take(10);
for i in sieve {
Expand Down
5 changes: 2 additions & 3 deletions rust/src/p0009.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ For example, 3**2 + 4**2 = 9 + 16 = 25 = 5**2.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
*/
const MAX: u32 = 500;

pub fn p0009() -> i128 {
for c in 3..MAX {
for c in 3.. {
let c_square = c * c;
for b in 2..c {
let b_square = b * b;
Expand All @@ -28,5 +27,5 @@ pub fn p0009() -> i128 {
}
}
}
return 0;
unreachable!();
}
2 changes: 1 addition & 1 deletion rust/src/p0012.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ pub fn p0012() -> i128 {
return num.into();
}
}
return -1;
unreachable!();
}

0 comments on commit 62d10ff

Please sign in to comment.