@@ -404,8 +404,8 @@ fn test_result_descriptions() {
404404 let conn = or_fail ! ( PostgresConnection :: connect( "postgres://postgres@localhost" , & NoSsl ) ) ;
405405 let stmt = or_fail ! ( conn. prepare( "SELECT 1::INT as a, 'hi'::VARCHAR as b" ) ) ;
406406 assert ! ( stmt. result_descriptions( ) ==
407- [ ResultDescription { name: "a" . to_string ( ) , ty: PgInt4 } ,
408- ResultDescription { name: "b" . to_string ( ) , ty: PgVarchar } ] ) ;
407+ [ ResultDescription { name: "a" . to_str ( ) , ty: PgInt4 } ,
408+ ResultDescription { name: "b" . to_str ( ) , ty: PgVarchar } ] ) ;
409409}
410410
411411#[ test]
@@ -447,8 +447,8 @@ fn test_i8_params() {
447447
448448#[ test]
449449fn test_name_params ( ) {
450- test_type ( "NAME" , [ ( Some ( "hello world" . to_string ( ) ) , "'hello world'" ) ,
451- ( Some ( "イロハニホヘト チリヌルヲ" . to_string ( ) ) , "'イロハニホヘト チリヌルヲ'" ) ,
450+ test_type ( "NAME" , [ ( Some ( "hello world" . to_str ( ) ) , "'hello world'" ) ,
451+ ( Some ( "イロハニホヘト チリヌルヲ" . to_str ( ) ) , "'イロハニホヘト チリヌルヲ'" ) ,
452452 ( None , "NULL" ) ] ) ;
453453}
454454
@@ -488,15 +488,15 @@ fn test_f64_params() {
488488
489489#[ test]
490490fn test_varchar_params ( ) {
491- test_type ( "VARCHAR" , [ ( Some ( "hello world" . to_string ( ) ) , "'hello world'" ) ,
492- ( Some ( "イロハニホヘト チリヌルヲ" . to_string ( ) ) , "'イロハニホヘト チリヌルヲ'" ) ,
491+ test_type ( "VARCHAR" , [ ( Some ( "hello world" . to_str ( ) ) , "'hello world'" ) ,
492+ ( Some ( "イロハニホヘト チリヌルヲ" . to_str ( ) ) , "'イロハニホヘト チリヌルヲ'" ) ,
493493 ( None , "NULL" ) ] ) ;
494494}
495495
496496#[ test]
497497fn test_text_params ( ) {
498- test_type ( "TEXT" , [ ( Some ( "hello world" . to_string ( ) ) , "'hello world'" ) ,
499- ( Some ( "イロハニホヘト チリヌルヲ" . to_string ( ) ) , "'イロハニホヘト チリヌルヲ'" ) ,
498+ test_type ( "TEXT" , [ ( Some ( "hello world" . to_str ( ) ) , "'hello world'" ) ,
499+ ( Some ( "イロハニホヘト チリヌルヲ" . to_str ( ) ) , "'イロハニホヘト チリヌルヲ'" ) ,
500500 ( None , "NULL" ) ] ) ;
501501}
502502
@@ -513,7 +513,7 @@ fn test_bpchar_params() {
513513 let stmt = or_fail ! ( conn. prepare( "SELECT b FROM foo ORDER BY id" ) ) ;
514514 let res = or_fail ! ( stmt. query( [ ] ) ) ;
515515
516- assert_eq ! ( vec!( Some ( "12345" . to_string ( ) ) , Some ( "123 " . to_string ( ) ) , None ) ,
516+ assert_eq ! ( vec!( Some ( "12345" . to_str ( ) ) , Some ( "123 " . to_str ( ) ) , None ) ,
517517 res. map( |row| row[ 1 ] ) . collect( ) ) ;
518518}
519519
@@ -558,7 +558,7 @@ fn test_tm_params() {
558558
559559macro_rules! test_range(
560560 ( $name: expr, $t: ty, $low: expr, $low_str: expr, $high: expr, $high_str: expr) => ( {
561- let tests = [ ( Some ( range!( '(' , ')' ) ) , "'(,)'" . to_string ( ) ) ,
561+ let tests = [ ( Some ( range!( '(' , ')' ) ) , "'(,)'" . to_str ( ) ) ,
562562 ( Some ( range!( '[' $low, ')' ) ) , format!( "'[{},)'" , $low_str) ) ,
563563 ( Some ( range!( '(' $low, ')' ) ) , format!( "'({},)'" , $low_str) ) ,
564564 ( Some ( range!( '(' , $high ']' ) ) , format!( "'(,{}]'" , $high_str) ) ,
@@ -571,8 +571,8 @@ macro_rules! test_range(
571571 format!( "'({},{}]'" , $low_str, $high_str) ) ,
572572 ( Some ( range!( '(' $low, $high ')' ) ) ,
573573 format!( "'({},{})'" , $low_str, $high_str) ) ,
574- ( Some ( range!( empty) ) , "'empty'" . to_string ( ) ) ,
575- ( None , "NULL" . to_string ( ) ) ] ;
574+ ( Some ( range!( empty) ) , "'empty'" . to_str ( ) ) ,
575+ ( None , "NULL" . to_str ( ) ) ] ;
576576 test_type( $name, tests) ;
577577 } )
578578)
@@ -610,7 +610,7 @@ macro_rules! test_array_params(
610610 ( $name: expr, $v1: expr, $s1: expr, $v2: expr, $s2: expr, $v3: expr, $s3: expr) => ( {
611611 let tests = [ ( Some ( ArrayBase :: from_vec( vec!( Some ( $v1) , Some ( $v2) , None ) , 1 ) ) ,
612612 format!( r"'\{{},{},NULL\}'" , $s1, $s2) . into_string( ) ) ,
613- ( None , "NULL" . to_string ( ) ) ] ;
613+ ( None , "NULL" . to_str ( ) ) ] ;
614614 test_type( format!( "{}[]" , $name) . as_slice( ) , tests) ;
615615 let mut a = ArrayBase :: from_vec( vec!( Some ( $v1) , Some ( $v2) ) , 0 ) ;
616616 a. wrap( -1 ) ;
@@ -640,8 +640,8 @@ fn test_chararray_params() {
640640
641641#[ test]
642642fn test_namearray_params ( ) {
643- test_array_params ! ( "NAME" , "hello" . to_string ( ) , "hello" , "world" . to_string ( ) ,
644- "world" , "!" . to_string ( ) , "!" ) ;
643+ test_array_params ! ( "NAME" , "hello" . to_str ( ) , "hello" , "world" . to_str ( ) ,
644+ "world" , "!" . to_str ( ) , "!" ) ;
645645}
646646
647647#[ test]
@@ -656,20 +656,20 @@ fn test_int4array_params() {
656656
657657#[ test]
658658fn test_textarray_params ( ) {
659- test_array_params ! ( "TEXT" , "hello" . to_string ( ) , "hello" , "world" . to_string ( ) ,
660- "world" , "!" . to_string ( ) , "!" ) ;
659+ test_array_params ! ( "TEXT" , "hello" . to_str ( ) , "hello" , "world" . to_str ( ) ,
660+ "world" , "!" . to_str ( ) , "!" ) ;
661661}
662662
663663#[ test]
664664fn test_charnarray_params ( ) {
665- test_array_params ! ( "CHAR(5)" , "hello" . to_string ( ) , "hello" ,
666- "world" . to_string ( ) , "world" , "! " . to_string ( ) , "!" ) ;
665+ test_array_params ! ( "CHAR(5)" , "hello" . to_str ( ) , "hello" ,
666+ "world" . to_str ( ) , "world" , "! " . to_str ( ) , "!" ) ;
667667}
668668
669669#[ test]
670670fn test_varchararray_params ( ) {
671- test_array_params ! ( "VARCHAR" , "hello" . to_string ( ) , "hello" ,
672- "world" . to_string ( ) , "world" , "!" . to_string ( ) , "!" ) ;
671+ test_array_params ! ( "VARCHAR" , "hello" . to_str ( ) , "hello" ,
672+ "world" . to_str ( ) , "world" , "!" . to_str ( ) , "!" ) ;
673673}
674674
675675#[ test]
@@ -753,10 +753,10 @@ fn test_hstore_params() {
753753 } )
754754 )
755755 test_type ( "hstore" ,
756- [ ( Some ( make_map ! ( "a" . to_string ( ) => Some ( "1" . to_string ( ) ) ) ) , "'a=>1'" ) ,
757- ( Some ( make_map ! ( "hello" . to_string ( ) => Some ( "world!" . to_string ( ) ) ,
758- "hola" . to_string ( ) => Some ( "mundo!" . to_string ( ) ) ,
759- "what" . to_string ( ) => None ) ) ,
756+ [ ( Some ( make_map ! ( "a" . to_str ( ) => Some ( "1" . to_str ( ) ) ) ) , "'a=>1'" ) ,
757+ ( Some ( make_map ! ( "hello" . to_str ( ) => Some ( "world!" . to_str ( ) ) ,
758+ "hola" . to_str ( ) => Some ( "mundo!" . to_str ( ) ) ,
759+ "what" . to_str ( ) => None ) ) ,
760760 "'hello=>world!,hola=>mundo!,what=>NULL'" ) ,
761761 ( None , "NULL" ) ] ) ;
762762}
@@ -909,21 +909,21 @@ fn test_notification_iterator_some() {
909909
910910 check_notification ( PostgresNotification {
911911 pid : 0 ,
912- channel : "test_notification_iterator_one_channel" . to_string ( ) ,
913- payload : "hello" . to_string ( )
912+ channel : "test_notification_iterator_one_channel" . to_str ( ) ,
913+ payload : "hello" . to_str ( )
914914 } , it. next ( ) ) ;
915915 check_notification ( PostgresNotification {
916916 pid : 0 ,
917- channel : "test_notification_iterator_one_channel2" . to_string ( ) ,
918- payload : "world" . to_string ( )
917+ channel : "test_notification_iterator_one_channel2" . to_str ( ) ,
918+ payload : "world" . to_str ( )
919919 } , it. next ( ) ) ;
920920 assert ! ( it. next( ) . is_none( ) ) ;
921921
922922 or_fail ! ( conn. execute( "NOTIFY test_notification_iterator_one_channel, '!'" , [ ] ) ) ;
923923 check_notification ( PostgresNotification {
924924 pid : 0 ,
925- channel : "test_notification_iterator_one_channel" . to_string ( ) ,
926- payload : "!" . to_string ( )
925+ channel : "test_notification_iterator_one_channel" . to_str ( ) ,
926+ payload : "!" . to_str ( )
927927 } , it. next ( ) ) ;
928928 assert ! ( it. next( ) . is_none( ) ) ;
929929}
0 commit comments