Skip to content

Commit 19156b2

Browse files
committed
Import std io
1 parent 455e22c commit 19156b2

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/lib.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extern crate postgres_protocol;
8383
use std::cell::{Cell, RefCell};
8484
use std::collections::{VecDeque, HashMap};
8585
use std::fmt;
86-
use std::io::prelude::*;
86+
use std::io;
8787
use std::mem;
8888
use std::result;
8989
use std::sync::Arc;
@@ -201,13 +201,13 @@ pub fn cancel_query<T>(params: T,
201201
Ok(())
202202
}
203203

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,
206206
"the server returned an unexpected response")
207207
}
208208

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,
211211
"communication with the server has desynchronized due to an earlier IO \
212212
error")
213213
}
@@ -322,7 +322,7 @@ impl InnerConnection {
322322
Ok(conn)
323323
}
324324

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> {
326326
debug_assert!(!self.desynchronized);
327327
loop {
328328
match try_desync!(self, self.stream.read_message()) {
@@ -341,7 +341,7 @@ impl InnerConnection {
341341

342342
fn read_message_with_notification_timeout(&mut self,
343343
timeout: Duration)
344-
-> std::io::Result<Option<backend::Message>> {
344+
-> io::Result<Option<backend::Message>> {
345345
debug_assert!(!self.desynchronized);
346346
loop {
347347
match try_desync!(self, self.stream.read_message_timeout(timeout)) {
@@ -359,7 +359,7 @@ impl InnerConnection {
359359
}
360360

361361
fn read_message_with_notification_nonblocking(&mut self)
362-
-> std::io::Result<Option<backend::Message>> {
362+
-> io::Result<Option<backend::Message>> {
363363
debug_assert!(!self.desynchronized);
364364
loop {
365365
match try_desync!(self, self.stream.read_message_nonblocking()) {
@@ -376,7 +376,7 @@ impl InnerConnection {
376376
}
377377
}
378378

379-
fn read_message(&mut self) -> std::io::Result<backend::Message> {
379+
fn read_message(&mut self) -> io::Result<backend::Message> {
380380
loop {
381381
match try!(self.read_message_with_notification()) {
382382
backend::Message::NotificationResponse { process_id, channel, payload } => {
@@ -413,7 +413,7 @@ impl InnerConnection {
413413
backend::Message::AuthenticationSCMCredential |
414414
backend::Message::AuthenticationGSS |
415415
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,
417417
"unsupported authentication")))
418418
}
419419
backend::Message::ErrorResponse { fields } => return DbError::new_connect(fields),
@@ -436,7 +436,7 @@ impl InnerConnection {
436436

437437
try!(self.stream.write_message(|buf| frontend::parse(stmt_name, query, None, buf)));
438438
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))));
440440
try!(self.stream.flush());
441441

442442
match try!(self.read_message()) {
@@ -497,7 +497,7 @@ impl InnerConnection {
497497
frontend::copy_fail("COPY queries cannot be directly executed", buf)
498498
}));
499499
try!(self.stream
500-
.write_message(|buf| Ok::<(), std::io::Error>(frontend::sync(buf))));
500+
.write_message(|buf| Ok::<(), io::Error>(frontend::sync(buf))));
501501
try!(self.stream.flush());
502502
}
503503
backend::Message::CopyOutResponse { .. } => {
@@ -506,7 +506,7 @@ impl InnerConnection {
506506
break;
507507
}
508508
}
509-
return Err(Error::Io(std::io::Error::new(std::io::ErrorKind::InvalidInput,
509+
return Err(Error::Io(io::Error::new(io::ErrorKind::InvalidInput,
510510
"COPY queries cannot be directly \
511511
executed")));
512512
}
@@ -560,7 +560,7 @@ impl InnerConnection {
560560
}
561561

562562
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))));
564564
try!(self.stream.flush());
565565

566566
match try!(self.read_message()) {
@@ -616,7 +616,7 @@ impl InnerConnection {
616616

617617
fn close_statement(&mut self, name: &str, type_: u8) -> Result<()> {
618618
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))));
620620
try!(self.stream.flush());
621621
let resp = match try!(self.read_message()) {
622622
backend::Message::CloseComplete => Ok(()),
@@ -838,7 +838,7 @@ impl InnerConnection {
838838
frontend::copy_fail("COPY queries cannot be directly executed", buf)
839839
}));
840840
try!(self.stream
841-
.write_message(|buf| Ok::<(), std::io::Error>(frontend::sync(buf))));
841+
.write_message(|buf| Ok::<(), io::Error>(frontend::sync(buf))));
842842
try!(self.stream.flush());
843843
}
844844
backend::Message::ErrorResponse { fields } => {
@@ -853,7 +853,7 @@ impl InnerConnection {
853853

854854
fn finish_inner(&mut self) -> Result<()> {
855855
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))));
857857
try!(self.stream.flush());
858858
Ok(())
859859
}

0 commit comments

Comments
 (0)