@@ -40,9 +40,9 @@ pub fn random_odd_uint<const L: usize>(
4040 // Will not overflow since `bit_length` is ensured to be within the size of the integer.
4141 random |= Uint :: < L > :: ONE
4242 . overflowing_shl_vartime ( bit_length - 1 )
43- . expect ( "shift within range" ) ;
43+ . expect ( "shift should be within range by construction " ) ;
4444
45- Odd :: new ( random) . expect ( "ensured to be odd" )
45+ Odd :: new ( random) . expect ( "the number should be odd by construction " )
4646}
4747
4848// The type we use to calculate incremental residues.
@@ -164,7 +164,7 @@ impl<const L: usize> Sieve<L> {
164164 self . base = self
165165 . base
166166 . checked_add ( & self . incr . into ( ) )
167- . expect ( "Integer overflow" ) ;
167+ . expect ( "addition should not overflow by construction " ) ;
168168
169169 self . incr = 0 ;
170170
@@ -190,7 +190,7 @@ impl<const L: usize> Sieve<L> {
190190 // and `INCR_LIMIT` fits into `Residue`.
191191 let incr_limit_small: Residue = incr_limit. as_words ( ) [ 0 ]
192192 . try_into ( )
193- . expect ( "ensured to fit within `Residue`" ) ;
193+ . expect ( "the increment limit should fit within `Residue`" ) ;
194194 incr_limit_small
195195 } ;
196196
@@ -233,7 +233,7 @@ impl<const L: usize> Sieve<L> {
233233 let mut num: Uint < L > = self
234234 . base
235235 . checked_add ( & self . incr . into ( ) )
236- . expect ( "Integer overflow" ) ;
236+ . expect ( "addition should not overflow by construction " ) ;
237237 if self . safe_primes {
238238 num = num. wrapping_shl_vartime ( 1 ) | Uint :: < L > :: ONE ;
239239 }
0 commit comments