File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -714,16 +714,19 @@ mod tests {
714714 & sql_str_base. to_lowercase ( ) , // lowercase
715715 & sql_str_base. to_uppercase ( ) , // UPPERCASE
716716 ] {
717- let value1: SqlType = serde_json:: from_str ( & format ! ( "\" {}\" " , sql_str) ) . expect (
718- & format ! ( "\" {sql_str}\" should deserialize into its SQL type" ) ,
719- ) ;
717+ let value1: SqlType = serde_json:: from_str ( & format ! ( "\" {}\" " , sql_str) )
718+ . unwrap_or_else ( |_| {
719+ panic ! ( "\" {sql_str}\" should deserialize into its SQL type" )
720+ } ) ;
720721 assert_eq ! ( value1, expected_value) ;
721722 let serialized_str =
722723 serde_json:: to_string ( & value1) . expect ( "Value should serialize into JSON" ) ;
723- let value2: SqlType = serde_json:: from_str ( & serialized_str) . expect ( & format ! (
724- "{} should deserialize back into its SQL type" ,
725- serialized_str
726- ) ) ;
724+ let value2: SqlType = serde_json:: from_str ( & serialized_str) . unwrap_or_else ( |_| {
725+ panic ! (
726+ "{} should deserialize back into its SQL type" ,
727+ serialized_str
728+ )
729+ } ) ;
727730 assert_eq ! ( value1, value2) ;
728731 }
729732 }
You can’t perform that action at this time.
0 commit comments