@@ -96,7 +96,7 @@ impl Prng {
9696 /// low risk tolerance, see the module-level comment.**
9797 pub fn seed ( & self , seed : Bytes ) {
9898 let env = self . env ( ) ;
99- assert_in_contract ! ( env) ;
99+ debug_assert_in_contract ! ( env) ;
100100 internal:: Env :: prng_reseed ( env, seed. into ( ) ) . unwrap_infallible ( ) ;
101101 }
102102
@@ -380,7 +380,7 @@ impl Prng {
380380impl < T > Shuffle for Vec < T > {
381381 fn shuffle ( & mut self , prng : & Prng ) {
382382 let env = prng. env ( ) ;
383- assert_in_contract ! ( env) ;
383+ debug_assert_in_contract ! ( env) ;
384384 let obj = internal:: Env :: prng_vec_shuffle ( env, self . to_object ( ) ) . unwrap_infallible ( ) ;
385385 * self = unsafe { Self :: unchecked_new ( env. clone ( ) , obj) } ;
386386 }
@@ -456,7 +456,7 @@ impl Fill for u64 {
456456impl Gen for u64 {
457457 fn gen ( prng : & Prng ) -> Self {
458458 let env = prng. env ( ) ;
459- assert_in_contract ! ( env) ;
459+ debug_assert_in_contract ! ( env) ;
460460 internal:: Env :: prng_u64_in_inclusive_range ( env, u64:: MIN , u64:: MAX ) . unwrap_infallible ( )
461461 }
462462}
@@ -466,7 +466,7 @@ impl GenRange for u64 {
466466
467467 fn gen_range ( prng : & Prng , r : impl RangeBounds < Self :: RangeBound > ) -> Self {
468468 let env = prng. env ( ) ;
469- assert_in_contract ! ( env) ;
469+ debug_assert_in_contract ! ( env) ;
470470 let start_bound = match r. start_bound ( ) {
471471 Bound :: Included ( b) => * b,
472472 Bound :: Excluded ( b) => b
@@ -493,7 +493,7 @@ impl Fill for Bytes {
493493 /// If the length of Bytes is greater than u32::MAX in length.
494494 fn fill ( & mut self , prng : & Prng ) {
495495 let env = prng. env ( ) ;
496- assert_in_contract ! ( env) ;
496+ debug_assert_in_contract ! ( env) ;
497497 let len: u32 = self . len ( ) ;
498498 let obj = internal:: Env :: prng_bytes_new ( env, len. into ( ) ) . unwrap_infallible ( ) ;
499499 * self = unsafe { Bytes :: unchecked_new ( env. clone ( ) , obj) } ;
@@ -505,7 +505,7 @@ impl GenLen for Bytes {
505505 /// Generates the Bytes with the Prng of the given length.
506506 fn gen_len ( prng : & Prng , len : u32 ) -> Self {
507507 let env = prng. env ( ) ;
508- assert_in_contract ! ( env) ;
508+ debug_assert_in_contract ! ( env) ;
509509 let obj = internal:: Env :: prng_bytes_new ( env, len. into ( ) ) . unwrap_infallible ( ) ;
510510 unsafe { Bytes :: unchecked_new ( env. clone ( ) , obj) }
511511 }
@@ -531,7 +531,7 @@ impl<const N: usize> Gen for BytesN<N> {
531531 /// If the length of BytesN is greater than u32::MAX in length.
532532 fn gen ( prng : & Prng ) -> Self {
533533 let env = prng. env ( ) ;
534- assert_in_contract ! ( env) ;
534+ debug_assert_in_contract ! ( env) ;
535535 let len: u32 = N . try_into ( ) . unwrap_optimized ( ) ;
536536 let obj = internal:: Env :: prng_bytes_new ( env, len. into ( ) ) . unwrap_infallible ( ) ;
537537 unsafe { BytesN :: unchecked_new ( env. clone ( ) , obj) }
@@ -546,7 +546,7 @@ impl Fill for [u8] {
546546 /// If the slice is greater than u32::MAX in length.
547547 fn fill ( & mut self , prng : & Prng ) {
548548 let env = prng. env ( ) ;
549- assert_in_contract ! ( env) ;
549+ debug_assert_in_contract ! ( env) ;
550550 let len: u32 = self . len ( ) . try_into ( ) . unwrap_optimized ( ) ;
551551 let bytes: Bytes = internal:: Env :: prng_bytes_new ( env, len. into ( ) )
552552 . unwrap_infallible ( )
@@ -563,7 +563,7 @@ impl<const N: usize> Fill for [u8; N] {
563563 /// If the array is greater than u32::MAX in length.
564564 fn fill ( & mut self , prng : & Prng ) {
565565 let env = prng. env ( ) ;
566- assert_in_contract ! ( env) ;
566+ debug_assert_in_contract ! ( env) ;
567567 let len: u32 = N . try_into ( ) . unwrap_optimized ( ) ;
568568 let bytes: Bytes = internal:: Env :: prng_bytes_new ( env, len. into ( ) )
569569 . unwrap_infallible ( )
0 commit comments