[clippy] stricter lints
This commit is contained in:
parent
1a7e57404e
commit
c31d2fda26
@ -5,12 +5,17 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
|
[lints.rust]
|
||||||
|
unsafe_code = "forbid"
|
||||||
|
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
pedantic = "warn"
|
pedantic = { level = "warn", priority = -1 }
|
||||||
|
todo = "warn"
|
||||||
|
unwrap_used = "warn"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
debug = false
|
debug = false
|
||||||
strip = true
|
strip = true
|
||||||
|
panic = "unwind"
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
panic = "unwind"
|
|
@ -38,10 +38,10 @@ fn find_next_prime(nr: &mut u64, sieve: &mut [bool]) -> Option<u64> {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
fn check_off_multiples_of_nr(nr: u64, sieve: &mut [bool]) {
|
fn check_off_multiples_of_nr(nr: u64, sieve: &mut [bool]) {
|
||||||
|
|
||||||
let nr = usize::try_from(nr).unwrap();
|
let nr = usize::try_from(nr).unwrap();
|
||||||
|
|
||||||
sieve
|
sieve
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.skip(nr.checked_mul(2).unwrap())
|
.skip(nr.checked_mul(2).unwrap())
|
||||||
|
Loading…
Reference in New Issue
Block a user