@@ -54,7 +54,6 @@ extern crate postgres_protocol;
54
54
use std:: cell:: { Cell , RefCell } ;
55
55
use std:: collections:: { VecDeque , HashMap } ;
56
56
use std:: fmt;
57
- use std:: io as std_io;
58
57
use std:: io:: prelude:: * ;
59
58
use std:: mem;
60
59
use std:: result;
@@ -173,13 +172,13 @@ pub fn cancel_query<T>(params: T,
173
172
Ok ( ( ) )
174
173
}
175
174
176
- fn bad_response ( ) -> std_io :: Error {
177
- std_io :: Error :: new ( std_io :: ErrorKind :: InvalidInput ,
175
+ fn bad_response ( ) -> std :: io :: Error {
176
+ std :: io :: Error :: new ( std :: io :: ErrorKind :: InvalidInput ,
178
177
"the server returned an unexpected response" )
179
178
}
180
179
181
- fn desynchronized ( ) -> std_io :: Error {
182
- std_io :: Error :: new ( std_io :: ErrorKind :: Other ,
180
+ fn desynchronized ( ) -> std :: io :: Error {
181
+ std :: io :: Error :: new ( std :: io :: ErrorKind :: Other ,
183
182
"communication with the server has desynchronized due to an earlier IO \
184
183
error")
185
184
}
@@ -294,7 +293,7 @@ impl InnerConnection {
294
293
Ok ( conn)
295
294
}
296
295
297
- fn read_message_with_notification ( & mut self ) -> std_io :: Result < backend:: Message > {
296
+ fn read_message_with_notification ( & mut self ) -> std :: io :: Result < backend:: Message > {
298
297
debug_assert ! ( !self . desynchronized) ;
299
298
loop {
300
299
match try_desync ! ( self , self . stream. read_message( ) ) {
@@ -348,7 +347,7 @@ impl InnerConnection {
348
347
}
349
348
}
350
349
351
- fn read_message ( & mut self ) -> std_io :: Result < backend:: Message > {
350
+ fn read_message ( & mut self ) -> std :: io :: Result < backend:: Message > {
352
351
loop {
353
352
match try!( self . read_message_with_notification ( ) ) {
354
353
backend:: Message :: NotificationResponse { process_id, channel, payload } => {
@@ -385,7 +384,7 @@ impl InnerConnection {
385
384
backend:: Message :: AuthenticationSCMCredential |
386
385
backend:: Message :: AuthenticationGSS |
387
386
backend:: Message :: AuthenticationSSPI => {
388
- return Err ( ConnectError :: Io ( std_io :: Error :: new ( std_io :: ErrorKind :: Other ,
387
+ return Err ( ConnectError :: Io ( std :: io :: Error :: new ( std :: io :: ErrorKind :: Other ,
389
388
"unsupported authentication" ) ) )
390
389
}
391
390
backend:: Message :: ErrorResponse { fields } => return DbError :: new_connect ( fields) ,
@@ -408,7 +407,7 @@ impl InnerConnection {
408
407
409
408
try!( self . stream . write_message ( |buf| frontend:: parse ( stmt_name, query, None , buf) ) ) ;
410
409
try!( self . stream . write_message ( |buf| frontend:: describe ( b'S' , stmt_name, buf) ) ) ;
411
- try!( self . stream . write_message ( |buf| Ok :: < ( ) , std_io :: Error > ( frontend:: sync ( buf) ) ) ) ;
410
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , std :: io :: Error > ( frontend:: sync ( buf) ) ) ) ;
412
411
try!( self . stream . flush ( ) ) ;
413
412
414
413
match try!( self . read_message ( ) ) {
@@ -469,7 +468,7 @@ impl InnerConnection {
469
468
frontend:: copy_fail ( "COPY queries cannot be directly executed" , buf)
470
469
} ) ) ;
471
470
try!( self . stream
472
- . write_message ( |buf| Ok :: < ( ) , std_io :: Error > ( frontend:: sync ( buf) ) ) ) ;
471
+ . write_message ( |buf| Ok :: < ( ) , std :: io :: Error > ( frontend:: sync ( buf) ) ) ) ;
473
472
try!( self . stream . flush ( ) ) ;
474
473
}
475
474
backend:: Message :: CopyOutResponse { .. } => {
@@ -478,7 +477,7 @@ impl InnerConnection {
478
477
break ;
479
478
}
480
479
}
481
- return Err ( Error :: Io ( std_io :: Error :: new ( std_io :: ErrorKind :: InvalidInput ,
480
+ return Err ( Error :: Io ( std :: io :: Error :: new ( std :: io :: ErrorKind :: InvalidInput ,
482
481
"COPY queries cannot be directly \
483
482
executed") ) ) ;
484
483
}
@@ -532,7 +531,7 @@ impl InnerConnection {
532
531
}
533
532
534
533
try!( self . stream . write_message ( |buf| frontend:: execute ( portal_name, row_limit, buf) ) ) ;
535
- try!( self . stream . write_message ( |buf| Ok :: < ( ) , std_io :: Error > ( frontend:: sync ( buf) ) ) ) ;
534
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , std :: io :: Error > ( frontend:: sync ( buf) ) ) ) ;
536
535
try!( self . stream . flush ( ) ) ;
537
536
538
537
match try!( self . read_message ( ) ) {
@@ -588,7 +587,7 @@ impl InnerConnection {
588
587
589
588
fn close_statement ( & mut self , name : & str , type_ : u8 ) -> Result < ( ) > {
590
589
try!( self . stream . write_message ( |buf| frontend:: close ( type_, name, buf) ) ) ;
591
- try!( self . stream . write_message ( |buf| Ok :: < ( ) , std_io :: Error > ( frontend:: sync ( buf) ) ) ) ;
590
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , std :: io :: Error > ( frontend:: sync ( buf) ) ) ) ;
592
591
try!( self . stream . flush ( ) ) ;
593
592
let resp = match try!( self . read_message ( ) ) {
594
593
backend:: Message :: CloseComplete => Ok ( ( ) ) ,
@@ -815,7 +814,7 @@ impl InnerConnection {
815
814
frontend:: copy_fail ( "COPY queries cannot be directly executed" , buf)
816
815
} ) ) ;
817
816
try!( self . stream
818
- . write_message ( |buf| Ok :: < ( ) , std_io :: Error > ( frontend:: sync ( buf) ) ) ) ;
817
+ . write_message ( |buf| Ok :: < ( ) , std :: io :: Error > ( frontend:: sync ( buf) ) ) ) ;
819
818
try!( self . stream . flush ( ) ) ;
820
819
}
821
820
backend:: Message :: ErrorResponse { fields } => {
@@ -830,7 +829,7 @@ impl InnerConnection {
830
829
831
830
fn finish_inner ( & mut self ) -> Result < ( ) > {
832
831
check_desync ! ( self ) ;
833
- try!( self . stream . write_message ( |buf| Ok :: < ( ) , std_io :: Error > ( frontend:: terminate ( buf) ) ) ) ;
832
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , std :: io :: Error > ( frontend:: terminate ( buf) ) ) ) ;
834
833
try!( self . stream . flush ( ) ) ;
835
834
Ok ( ( ) )
836
835
}
0 commit comments