@@ -83,7 +83,7 @@ extern crate postgres_protocol;
83
83
use std:: cell:: { Cell , RefCell } ;
84
84
use std:: collections:: { VecDeque , HashMap } ;
85
85
use std:: fmt;
86
- use std:: io:: prelude :: * ;
86
+ use std:: io;
87
87
use std:: mem;
88
88
use std:: result;
89
89
use std:: sync:: Arc ;
@@ -201,13 +201,13 @@ pub fn cancel_query<T>(params: T,
201
201
Ok ( ( ) )
202
202
}
203
203
204
- fn bad_response ( ) -> std :: io:: Error {
205
- std :: io:: Error :: new ( std :: io:: ErrorKind :: InvalidInput ,
204
+ fn bad_response ( ) -> io:: Error {
205
+ io:: Error :: new ( io:: ErrorKind :: InvalidInput ,
206
206
"the server returned an unexpected response" )
207
207
}
208
208
209
- fn desynchronized ( ) -> std :: io:: Error {
210
- std :: io:: Error :: new ( std :: io:: ErrorKind :: Other ,
209
+ fn desynchronized ( ) -> io:: Error {
210
+ io:: Error :: new ( io:: ErrorKind :: Other ,
211
211
"communication with the server has desynchronized due to an earlier IO \
212
212
error")
213
213
}
@@ -322,7 +322,7 @@ impl InnerConnection {
322
322
Ok ( conn)
323
323
}
324
324
325
- fn read_message_with_notification ( & mut self ) -> std :: io:: Result < backend:: Message > {
325
+ fn read_message_with_notification ( & mut self ) -> io:: Result < backend:: Message > {
326
326
debug_assert ! ( !self . desynchronized) ;
327
327
loop {
328
328
match try_desync ! ( self , self . stream. read_message( ) ) {
@@ -341,7 +341,7 @@ impl InnerConnection {
341
341
342
342
fn read_message_with_notification_timeout ( & mut self ,
343
343
timeout : Duration )
344
- -> std :: io:: Result < Option < backend:: Message > > {
344
+ -> io:: Result < Option < backend:: Message > > {
345
345
debug_assert ! ( !self . desynchronized) ;
346
346
loop {
347
347
match try_desync ! ( self , self . stream. read_message_timeout( timeout) ) {
@@ -359,7 +359,7 @@ impl InnerConnection {
359
359
}
360
360
361
361
fn read_message_with_notification_nonblocking ( & mut self )
362
- -> std :: io:: Result < Option < backend:: Message > > {
362
+ -> io:: Result < Option < backend:: Message > > {
363
363
debug_assert ! ( !self . desynchronized) ;
364
364
loop {
365
365
match try_desync ! ( self , self . stream. read_message_nonblocking( ) ) {
@@ -376,7 +376,7 @@ impl InnerConnection {
376
376
}
377
377
}
378
378
379
- fn read_message ( & mut self ) -> std :: io:: Result < backend:: Message > {
379
+ fn read_message ( & mut self ) -> io:: Result < backend:: Message > {
380
380
loop {
381
381
match try!( self . read_message_with_notification ( ) ) {
382
382
backend:: Message :: NotificationResponse { process_id, channel, payload } => {
@@ -413,7 +413,7 @@ impl InnerConnection {
413
413
backend:: Message :: AuthenticationSCMCredential |
414
414
backend:: Message :: AuthenticationGSS |
415
415
backend:: Message :: AuthenticationSSPI => {
416
- return Err ( ConnectError :: Io ( std :: io:: Error :: new ( std :: io:: ErrorKind :: Other ,
416
+ return Err ( ConnectError :: Io ( io:: Error :: new ( io:: ErrorKind :: Other ,
417
417
"unsupported authentication" ) ) )
418
418
}
419
419
backend:: Message :: ErrorResponse { fields } => return DbError :: new_connect ( fields) ,
@@ -436,7 +436,7 @@ impl InnerConnection {
436
436
437
437
try!( self . stream . write_message ( |buf| frontend:: parse ( stmt_name, query, None , buf) ) ) ;
438
438
try!( self . stream . write_message ( |buf| frontend:: describe ( b'S' , stmt_name, buf) ) ) ;
439
- try!( self . stream . write_message ( |buf| Ok :: < ( ) , std :: io:: Error > ( frontend:: sync ( buf) ) ) ) ;
439
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , io:: Error > ( frontend:: sync ( buf) ) ) ) ;
440
440
try!( self . stream . flush ( ) ) ;
441
441
442
442
match try!( self . read_message ( ) ) {
@@ -497,7 +497,7 @@ impl InnerConnection {
497
497
frontend:: copy_fail ( "COPY queries cannot be directly executed" , buf)
498
498
} ) ) ;
499
499
try!( self . stream
500
- . write_message ( |buf| Ok :: < ( ) , std :: io:: Error > ( frontend:: sync ( buf) ) ) ) ;
500
+ . write_message ( |buf| Ok :: < ( ) , io:: Error > ( frontend:: sync ( buf) ) ) ) ;
501
501
try!( self . stream . flush ( ) ) ;
502
502
}
503
503
backend:: Message :: CopyOutResponse { .. } => {
@@ -506,7 +506,7 @@ impl InnerConnection {
506
506
break ;
507
507
}
508
508
}
509
- return Err ( Error :: Io ( std :: io:: Error :: new ( std :: io:: ErrorKind :: InvalidInput ,
509
+ return Err ( Error :: Io ( io:: Error :: new ( io:: ErrorKind :: InvalidInput ,
510
510
"COPY queries cannot be directly \
511
511
executed") ) ) ;
512
512
}
@@ -560,7 +560,7 @@ impl InnerConnection {
560
560
}
561
561
562
562
try!( self . stream . write_message ( |buf| frontend:: execute ( portal_name, row_limit, buf) ) ) ;
563
- try!( self . stream . write_message ( |buf| Ok :: < ( ) , std :: io:: Error > ( frontend:: sync ( buf) ) ) ) ;
563
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , io:: Error > ( frontend:: sync ( buf) ) ) ) ;
564
564
try!( self . stream . flush ( ) ) ;
565
565
566
566
match try!( self . read_message ( ) ) {
@@ -616,7 +616,7 @@ impl InnerConnection {
616
616
617
617
fn close_statement ( & mut self , name : & str , type_ : u8 ) -> Result < ( ) > {
618
618
try!( self . stream . write_message ( |buf| frontend:: close ( type_, name, buf) ) ) ;
619
- try!( self . stream . write_message ( |buf| Ok :: < ( ) , std :: io:: Error > ( frontend:: sync ( buf) ) ) ) ;
619
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , io:: Error > ( frontend:: sync ( buf) ) ) ) ;
620
620
try!( self . stream . flush ( ) ) ;
621
621
let resp = match try!( self . read_message ( ) ) {
622
622
backend:: Message :: CloseComplete => Ok ( ( ) ) ,
@@ -838,7 +838,7 @@ impl InnerConnection {
838
838
frontend:: copy_fail ( "COPY queries cannot be directly executed" , buf)
839
839
} ) ) ;
840
840
try!( self . stream
841
- . write_message ( |buf| Ok :: < ( ) , std :: io:: Error > ( frontend:: sync ( buf) ) ) ) ;
841
+ . write_message ( |buf| Ok :: < ( ) , io:: Error > ( frontend:: sync ( buf) ) ) ) ;
842
842
try!( self . stream . flush ( ) ) ;
843
843
}
844
844
backend:: Message :: ErrorResponse { fields } => {
@@ -853,7 +853,7 @@ impl InnerConnection {
853
853
854
854
fn finish_inner ( & mut self ) -> Result < ( ) > {
855
855
check_desync ! ( self ) ;
856
- try!( self . stream . write_message ( |buf| Ok :: < ( ) , std :: io:: Error > ( frontend:: terminate ( buf) ) ) ) ;
856
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , io:: Error > ( frontend:: terminate ( buf) ) ) ) ;
857
857
try!( self . stream . flush ( ) ) ;
858
858
Ok ( ( ) )
859
859
}
0 commit comments