@@ -757,6 +757,7 @@ where
757757
758758#[ cfg( test) ]
759759mod tests {
760+ use core:: str:: FromStr ;
760761 use serde_derive:: Deserialize ;
761762
762763 #[ derive( Debug , Deserialize , PartialEq ) ]
@@ -1083,7 +1084,10 @@ mod tests {
10831084 assert_eq ! (
10841085 crate :: from_str:: <Xy >( r#"[10]"# ) ,
10851086 Err ( crate :: de:: Error :: CustomErrorWithMessage (
1086- "invalid length 1, expected tuple struct Xy with 2 elements" . into( )
1087+ heapless:: String :: from_str(
1088+ "invalid length 1, expected tuple struct Xy with 2 elements"
1089+ )
1090+ . unwrap( )
10871091 ) )
10881092 ) ;
10891093 assert_eq ! (
@@ -1190,7 +1194,9 @@ mod tests {
11901194 use serde:: de:: Error ;
11911195 assert_eq ! (
11921196 crate :: de:: Error :: custom( "something bad happened" ) ,
1193- crate :: de:: Error :: CustomErrorWithMessage ( "something bad happened" . into( ) )
1197+ crate :: de:: Error :: CustomErrorWithMessage (
1198+ heapless:: String :: from_str( "something bad happened" ) . unwrap( )
1199+ )
11941200 ) ;
11951201 }
11961202
@@ -1200,8 +1206,8 @@ mod tests {
12001206 use serde:: de:: Error ;
12011207 assert_eq ! (
12021208 crate :: de:: Error :: custom( "0123456789012345678901234567890123456789012345678901234567890123 <- after here the message should be truncated" ) ,
1203- crate :: de:: Error :: CustomErrorWithMessage (
1204- "0123456789012345678901234567890123456789012345678901234567890123" . into ( )
1209+ crate :: de:: Error :: CustomErrorWithMessage ( heapless :: String :: from_str (
1210+ "0123456789012345678901234567890123456789012345678901234567890123" ) . unwrap ( )
12051211 )
12061212 ) ;
12071213 }
0 commit comments