@@ -757,6 +757,7 @@ where
757
757
758
758
#[ cfg( test) ]
759
759
mod tests {
760
+ use core:: str:: FromStr ;
760
761
use serde_derive:: Deserialize ;
761
762
762
763
#[ derive( Debug , Deserialize , PartialEq ) ]
@@ -1083,7 +1084,10 @@ mod tests {
1083
1084
assert_eq ! (
1084
1085
crate :: from_str:: <Xy >( r#"[10]"# ) ,
1085
1086
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( )
1087
1091
) )
1088
1092
) ;
1089
1093
assert_eq ! (
@@ -1190,7 +1194,9 @@ mod tests {
1190
1194
use serde:: de:: Error ;
1191
1195
assert_eq ! (
1192
1196
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
+ )
1194
1200
) ;
1195
1201
}
1196
1202
@@ -1200,8 +1206,8 @@ mod tests {
1200
1206
use serde:: de:: Error ;
1201
1207
assert_eq ! (
1202
1208
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 ( )
1205
1211
)
1206
1212
) ;
1207
1213
}
0 commit comments