@@ -968,7 +968,7 @@ mod tests {
968
968
assert_eq ! ( crate :: from_str( r#" "👏" "# ) , Ok ( ( "👏" , 8 ) ) ) ;
969
969
970
970
fn s ( s : & ' static str ) -> heapless:: String < 1024 > {
971
- core :: str :: FromStr :: from_str ( s ) . expect ( "Failed to create test string" )
971
+ s . parse ( ) . expect ( "Failed to create test string" )
972
972
}
973
973
974
974
fn from_str_test < ' de , T : serde:: Deserialize < ' de > > (
@@ -1014,7 +1014,7 @@ mod tests {
1014
1014
#[ test]
1015
1015
fn tuple_of_str ( ) {
1016
1016
fn s ( s : & ' static str ) -> heapless:: String < 1024 > {
1017
- core :: str :: FromStr :: from_str ( s ) . expect ( "Failed to create test string" )
1017
+ s . parse ( ) . expect ( "Failed to create test string" )
1018
1018
}
1019
1019
1020
1020
fn from_str_test < ' de , T : serde:: Deserialize < ' de > > (
@@ -1271,10 +1271,9 @@ mod tests {
1271
1271
assert_eq ! (
1272
1272
crate :: from_str:: <Xy >( r#"[10]"# ) ,
1273
1273
Err ( crate :: de:: Error :: CustomErrorWithMessage (
1274
- core:: str :: FromStr :: from_str(
1275
- "invalid length 1, expected tuple struct Xy with 2 elements"
1276
- )
1277
- . unwrap( )
1274
+ "invalid length 1, expected tuple struct Xy with 2 elements"
1275
+ . parse( )
1276
+ . unwrap( )
1278
1277
) )
1279
1278
) ;
1280
1279
assert_eq ! (
@@ -1381,9 +1380,7 @@ mod tests {
1381
1380
use serde:: de:: Error ;
1382
1381
assert_eq ! (
1383
1382
crate :: de:: Error :: custom( "something bad happened" ) ,
1384
- crate :: de:: Error :: CustomErrorWithMessage (
1385
- core:: str :: FromStr :: from_str( "something bad happened" ) . unwrap( )
1386
- )
1383
+ crate :: de:: Error :: CustomErrorWithMessage ( "something bad happened" . parse( ) . unwrap( ) )
1387
1384
) ;
1388
1385
}
1389
1386
@@ -1393,8 +1390,8 @@ mod tests {
1393
1390
use serde:: de:: Error ;
1394
1391
assert_eq ! (
1395
1392
crate :: de:: Error :: custom( "0123456789012345678901234567890123456789012345678901234567890123 <- after here the message should be truncated" ) ,
1396
- crate :: de:: Error :: CustomErrorWithMessage ( core :: str :: FromStr :: from_str (
1397
- "0123456789012345678901234567890123456789012345678901234567890123" ) . unwrap( )
1393
+ crate :: de:: Error :: CustomErrorWithMessage (
1394
+ "0123456789012345678901234567890123456789012345678901234567890123" . parse ( ) . unwrap( )
1398
1395
)
1399
1396
) ;
1400
1397
}
0 commit comments