@@ -15,12 +15,7 @@ macro_rules! impl_field_map_for_int {
1515 type Output = RandomField <C >;
1616
1717 fn map_to_field( & self , config_ref: C ) -> Self :: Output {
18- let config = match config_ref. reference( ) {
19- Some ( config) => config,
20- None => {
21- panic!( "Cannot convert integer to prime field element without a modulus" )
22- }
23- } ;
18+ let config = config_ref. reference( ) ;
2419 let value = self . abs_diff( 0 ) ;
2520 let mut words = C :: W :: default ( ) ;
2621
@@ -67,10 +62,7 @@ impl<C: ConfigReference> FieldMap<C> for bool {
6762 type Output = RandomField < C > ;
6863
6964 fn map_to_field ( & self , config_ref : C ) -> Self :: Output {
70- let config = match config_ref. reference ( ) {
71- Some ( config) => config,
72- None => panic ! ( "Cannot convert boolean to prime field element without a modulus" ) ,
73- } ;
65+ let config = config_ref. reference ( ) ;
7466
7567 let mut r = C :: B :: from ( * self as u64 ) ;
7668 config. mul_assign ( & mut r, config. r2 ( ) ) ;
@@ -514,20 +506,6 @@ mod tests {
514506 test_unsigned_type_edge_cases ! ( u64 , field_1, config, ConfigRef :: <1 >) ;
515507 test_unsigned_type_edge_cases ! ( u128 , field_1, config, ConfigRef :: <1 >) ;
516508 }
517-
518- #[ test]
519- #[ should_panic( expected = "Cannot convert integer to prime field element without a modulus" ) ]
520- fn test_signed_field_map_null_config ( ) {
521- let i32_val: i32 = 5 ;
522- i32_val. map_to_field ( ConfigRef :: < 1 > :: NONE ) ;
523- }
524-
525- #[ test]
526- #[ should_panic( expected = "Cannot convert integer to prime field element without a modulus" ) ]
527- fn test_unsigned_field_map_null_config ( ) {
528- let u32_val: u32 = 5 ;
529- u32_val. map_to_field ( ConfigRef :: < 1 > :: NONE ) ;
530- }
531509}
532510
533511#[ cfg( test) ]
@@ -623,13 +601,6 @@ mod bigint_field_map_tests {
623601 ) ;
624602 }
625603
626- #[ test]
627- #[ should_panic( expected = "Cannot convert BigInt to prime field element without a modulus" ) ]
628- fn test_null_config ( ) {
629- let value = BigInt :: < 2 > :: from ( 123u64 ) ;
630- let _result = value. map_to_field ( ConfigRef :: < 2 > :: NONE ) ;
631- }
632-
633604 #[ test]
634605 fn test_bigint_max_value ( ) {
635606 let modulus = big_int ! ( 18446744069414584321 ) ;
0 commit comments