From da6ad2b821f2f091945d6b5036d1252aad46eb47 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 21 Sep 2016 22:16:38 -0700 Subject: [PATCH] Remove silly renamed import --- src/lib.rs | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9e63a779..2ed852e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,7 +54,6 @@ extern crate postgres_protocol; use std::cell::{Cell, RefCell}; use std::collections::{VecDeque, HashMap}; use std::fmt; -use std::io as std_io; use std::io::prelude::*; use std::mem; use std::result; @@ -173,13 +172,13 @@ pub fn cancel_query(params: T, Ok(()) } -fn bad_response() -> std_io::Error { - std_io::Error::new(std_io::ErrorKind::InvalidInput, +fn bad_response() -> std::io::Error { + std::io::Error::new(std::io::ErrorKind::InvalidInput, "the server returned an unexpected response") } -fn desynchronized() -> std_io::Error { - std_io::Error::new(std_io::ErrorKind::Other, +fn desynchronized() -> std::io::Error { + std::io::Error::new(std::io::ErrorKind::Other, "communication with the server has desynchronized due to an earlier IO \ error") } @@ -294,7 +293,7 @@ impl InnerConnection { Ok(conn) } - fn read_message_with_notification(&mut self) -> std_io::Result { + fn read_message_with_notification(&mut self) -> std::io::Result { debug_assert!(!self.desynchronized); loop { match try_desync!(self, self.stream.read_message()) { @@ -348,7 +347,7 @@ impl InnerConnection { } } - fn read_message(&mut self) -> std_io::Result { + fn read_message(&mut self) -> std::io::Result { loop { match try!(self.read_message_with_notification()) { backend::Message::NotificationResponse { process_id, channel, payload } => { @@ -385,7 +384,7 @@ impl InnerConnection { backend::Message::AuthenticationSCMCredential | backend::Message::AuthenticationGSS | backend::Message::AuthenticationSSPI => { - return Err(ConnectError::Io(std_io::Error::new(std_io::ErrorKind::Other, + return Err(ConnectError::Io(std::io::Error::new(std::io::ErrorKind::Other, "unsupported authentication"))) } backend::Message::ErrorResponse { fields } => return DbError::new_connect(fields), @@ -408,7 +407,7 @@ impl InnerConnection { try!(self.stream.write_message(|buf| frontend::parse(stmt_name, query, None, buf))); try!(self.stream.write_message(|buf| frontend::describe(b'S', stmt_name, buf))); - try!(self.stream.write_message(|buf| Ok::<(), std_io::Error>(frontend::sync(buf)))); + try!(self.stream.write_message(|buf| Ok::<(), std::io::Error>(frontend::sync(buf)))); try!(self.stream.flush()); match try!(self.read_message()) { @@ -469,7 +468,7 @@ impl InnerConnection { frontend::copy_fail("COPY queries cannot be directly executed", buf) })); try!(self.stream - .write_message(|buf| Ok::<(), std_io::Error>(frontend::sync(buf)))); + .write_message(|buf| Ok::<(), std::io::Error>(frontend::sync(buf)))); try!(self.stream.flush()); } backend::Message::CopyOutResponse { .. } => { @@ -478,7 +477,7 @@ impl InnerConnection { break; } } - return Err(Error::Io(std_io::Error::new(std_io::ErrorKind::InvalidInput, + return Err(Error::Io(std::io::Error::new(std::io::ErrorKind::InvalidInput, "COPY queries cannot be directly \ executed"))); } @@ -532,7 +531,7 @@ impl InnerConnection { } try!(self.stream.write_message(|buf| frontend::execute(portal_name, row_limit, buf))); - try!(self.stream.write_message(|buf| Ok::<(), std_io::Error>(frontend::sync(buf)))); + try!(self.stream.write_message(|buf| Ok::<(), std::io::Error>(frontend::sync(buf)))); try!(self.stream.flush()); match try!(self.read_message()) { @@ -588,7 +587,7 @@ impl InnerConnection { fn close_statement(&mut self, name: &str, type_: u8) -> Result<()> { try!(self.stream.write_message(|buf| frontend::close(type_, name, buf))); - try!(self.stream.write_message(|buf| Ok::<(), std_io::Error>(frontend::sync(buf)))); + try!(self.stream.write_message(|buf| Ok::<(), std::io::Error>(frontend::sync(buf)))); try!(self.stream.flush()); let resp = match try!(self.read_message()) { backend::Message::CloseComplete => Ok(()), @@ -815,7 +814,7 @@ impl InnerConnection { frontend::copy_fail("COPY queries cannot be directly executed", buf) })); try!(self.stream - .write_message(|buf| Ok::<(), std_io::Error>(frontend::sync(buf)))); + .write_message(|buf| Ok::<(), std::io::Error>(frontend::sync(buf)))); try!(self.stream.flush()); } backend::Message::ErrorResponse { fields } => { @@ -830,7 +829,7 @@ impl InnerConnection { fn finish_inner(&mut self) -> Result<()> { check_desync!(self); - try!(self.stream.write_message(|buf| Ok::<(), std_io::Error>(frontend::terminate(buf)))); + try!(self.stream.write_message(|buf| Ok::<(), std::io::Error>(frontend::terminate(buf)))); try!(self.stream.flush()); Ok(()) }