@@ -507,7 +507,7 @@ impl InnerPostgresConnection {
507
507
payload : payload
508
508
} ) ,
509
509
ParameterStatus { parameter, value } =>
510
- info ! ( "Parameter {} = {}" , parameter, value) ,
510
+ debug ! ( "Parameter {} = {}" , parameter, value) ,
511
511
val => return Ok ( val)
512
512
}
513
513
}
@@ -742,8 +742,7 @@ impl PostgresConnection {
742
742
/// Sets the notice handler for the connection, returning the old handler.
743
743
pub fn set_notice_handler ( & self , handler : ~PostgresNoticeHandler )
744
744
-> ~PostgresNoticeHandler {
745
- let mut conn = self . conn . borrow_mut ( ) ;
746
- conn. get ( ) . set_notice_handler ( handler)
745
+ self . conn . borrow_mut ( ) . set_notice_handler ( handler)
747
746
}
748
747
749
748
/// Returns an iterator over asynchronous notification messages.
@@ -776,7 +775,7 @@ impl PostgresConnection {
776
775
/// };
777
776
pub fn try_prepare < ' a > ( & ' a self , query : & str )
778
777
-> Result < NormalPostgresStatement < ' a > , PostgresError > {
779
- self . conn . with_mut ( |conn| conn . try_prepare ( query, self ) )
778
+ self . conn . borrow_mut ( ) . try_prepare ( query, self )
780
779
}
781
780
782
781
/// A convenience wrapper around `try_prepare`.
@@ -871,7 +870,7 @@ impl PostgresConnection {
871
870
/// Used with the `cancel_query` function. The object returned can be used
872
871
/// to cancel any query executed by the connection it was created from.
873
872
pub fn cancel_data ( & self ) -> PostgresCancelData {
874
- self . conn . with ( |conn| conn . cancel_data )
873
+ self . conn . borrow ( ) . cancel_data
875
874
}
876
875
877
876
/// Returns whether or not the stream has been desynchronized due to an
@@ -880,7 +879,7 @@ impl PostgresConnection {
880
879
/// If this has occurred, all further queries will immediately return an
881
880
/// error.
882
881
pub fn is_desynchronized ( & self ) -> bool {
883
- self . conn . with ( |conn| conn . is_desynchronized ( ) )
882
+ self . conn . borrow ( ) . is_desynchronized ( )
884
883
}
885
884
886
885
/// Consumes the connection, closing it.
@@ -889,27 +888,26 @@ impl PostgresConnection {
889
888
/// `PostgresConnection` except that it returns any error encountered to
890
889
/// the caller.
891
890
pub fn finish ( self ) -> Result < ( ) , PostgresError > {
892
- self . conn . with_mut ( |conn| {
893
- conn. finished = true ;
894
- conn. finish_inner ( )
895
- } )
891
+ let mut conn = self . conn . borrow_mut ( ) ;
892
+ conn. finished = true ;
893
+ conn. finish_inner ( )
896
894
}
897
895
898
896
fn quick_query ( & self , query : & str )
899
897
-> Result < Vec < Vec < Option < ~str > > > , PostgresError > {
900
- self . conn . with_mut ( |conn| conn . quick_query ( query) )
898
+ self . conn . borrow_mut ( ) . quick_query ( query)
901
899
}
902
900
903
901
fn wait_for_ready ( & self ) -> Result < ( ) , PostgresError > {
904
- self . conn . with_mut ( |conn| conn . wait_for_ready ( ) )
902
+ self . conn . borrow_mut ( ) . wait_for_ready ( )
905
903
}
906
904
907
905
fn read_message ( & self ) -> IoResult < BackendMessage > {
908
- self . conn . with_mut ( |conn| conn . read_message ( ) )
906
+ self . conn . borrow_mut ( ) . read_message ( )
909
907
}
910
908
911
909
fn write_messages ( & self , messages : & [ FrontendMessage ] ) -> IoResult < ( ) > {
912
- self . conn . with_mut ( |conn| conn . write_messages ( messages) )
910
+ self . conn . borrow_mut ( ) . write_messages ( messages)
913
911
}
914
912
}
915
913
0 commit comments