diff --git a/src/sieving.rs b/src/sieving.rs index 33e34ff..d846fda 100644 --- a/src/sieving.rs +++ b/src/sieving.rs @@ -126,12 +126,10 @@ pub const fn sieve_lt( assert!(N > 0, "`N` must be at least 1"); assert!(MEM >= N, "`MEM` must be at least as large as `N`"); - let mem_sqr = { - let mem64 = MEM as u64; - match mem64.checked_mul(mem64) { - Some(prod) => prod, - None => panic!("`MEM`^2 must fit in a `u64`"), - } + let mem64 = MEM as u64; + + let Some(mem_sqr) = mem64.checked_mul(mem64) else { + panic!("`MEM`^2 must fit in a `u64`"); }; if upper_limit > mem_sqr { @@ -307,12 +305,10 @@ pub const fn sieve_geq( assert!(N > 0, "`N` must be at least 1"); assert!(MEM >= N, "`MEM` must be at least as large as `N`"); - let (mem64, mem_sqr) = { - let mem64 = MEM as u64; - match mem64.checked_mul(mem64) { - Some(prod) => (mem64, prod), - None => panic!("`MEM`^2 must fit in a `u64`"), - } + let mem64 = MEM as u64; + + let Some(mem_sqr) = mem64.checked_mul(mem64) else { + panic!("`MEM`^2 must fit in a `u64`"); }; let Some(upper_limit) = mem64.checked_add(lower_limit) else {