@@ -267,7 +267,7 @@ fn test_registry_value_into_lua() -> Result<()> {
267267 let r = lua. create_registry_value ( & s) ?;
268268 let value1 = lua. pack ( & r) ?;
269269 let value2 = lua. pack ( r) ?;
270- assert_eq ! ( value1. as_str ( ) . as_deref ( ) , Some ( "hello, world" ) ) ;
270+ assert_eq ! ( value1. to_string ( ) ? , "hello, world" ) ;
271271 assert_eq ! ( value1. to_pointer( ) , value2. to_pointer( ) ) ;
272272
273273 // Push into stack
@@ -560,11 +560,11 @@ fn test_osstring_into_from_lua() -> Result<()> {
560560
561561 let v = lua. pack ( s. as_os_str ( ) ) ?;
562562 assert ! ( v. is_string( ) ) ;
563- assert_eq ! ( v. as_str ( ) . unwrap( ) , "hello, world" ) ;
563+ assert_eq ! ( v. as_string ( ) . unwrap( ) , "hello, world" ) ;
564564
565565 let v = lua. pack ( s) ?;
566566 assert ! ( v. is_string( ) ) ;
567- assert_eq ! ( v. as_str ( ) . unwrap( ) , "hello, world" ) ;
567+ assert_eq ! ( v. as_string ( ) . unwrap( ) , "hello, world" ) ;
568568
569569 let s = lua. create_string ( "hello, world" ) ?;
570570 let bstr = lua. unpack :: < OsString > ( Value :: String ( s) ) ?;
@@ -588,11 +588,11 @@ fn test_pathbuf_into_from_lua() -> Result<()> {
588588
589589 let v = lua. pack ( pb. as_path ( ) ) ?;
590590 assert ! ( v. is_string( ) ) ;
591- assert_eq ! ( v. as_str ( ) . unwrap( ) , pb_str) ;
591+ assert_eq ! ( v. to_string ( ) . unwrap( ) , pb_str) ;
592592
593593 let v = lua. pack ( pb. clone ( ) ) ?;
594594 assert ! ( v. is_string( ) ) ;
595- assert_eq ! ( v. as_str ( ) . unwrap( ) , pb_str) ;
595+ assert_eq ! ( v. to_string ( ) . unwrap( ) , pb_str) ;
596596
597597 let s = lua. create_string ( pb_str) ?;
598598 let bstr = lua. unpack :: < PathBuf > ( Value :: String ( s) ) ?;
@@ -724,7 +724,7 @@ fn test_char_into_lua() -> Result<()> {
724724
725725 let v = '🦀' ;
726726 let v2 = v. into_lua ( & lua) ?;
727- assert_eq ! ( Some ( v . to_string ( ) ) , v2 . as_string_lossy ( ) ) ;
727+ assert_eq ! ( * v2 . as_string ( ) . unwrap ( ) , v . to_string ( ) ) ;
728728
729729 Ok ( ( ) )
730730}
0 commit comments