Skip to content

Commit d381269

Browse files
committed
Fix errors from variant type namespace thing
1 parent 45e95f5 commit d381269

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/error.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
33
use std::collections::HashMap;
44
use std::from_str::FromStr;
5-
use std::io::IoError;
5+
use std::io;
66
use std::fmt;
77

8-
use openssl::ssl::error::SslError;
8+
use openssl::ssl::error;
99
use phf::PhfMap;
1010

1111
use types::PostgresType;
@@ -364,7 +364,7 @@ pub enum PostgresConnectError {
364364
/// The URL was missing a user
365365
MissingUser,
366366
/// There was an error opening a socket to the server
367-
SocketError(IoError),
367+
SocketError(io::IoError),
368368
/// An error from the Postgres server itself
369369
PgConnectDbError(PostgresDbError),
370370
/// A password was required but not provided in the URL
@@ -375,9 +375,9 @@ pub enum PostgresConnectError {
375375
/// The Postgres server does not support SSL encryption
376376
NoSslSupport,
377377
/// There was an error initializing the SSL session
378-
SslError(SslError),
378+
SslError(error::SslError),
379379
/// There was an error communicating with the server
380-
PgConnectStreamError(IoError),
380+
PgConnectStreamError(io::IoError),
381381
/// The server sent an unexpected response
382382
PgConnectBadResponse,
383383
}
@@ -523,7 +523,7 @@ pub enum PostgresError {
523523
/// An error reported by the Postgres server
524524
PgDbError(PostgresDbError),
525525
/// An error communicating with the Postgres server
526-
PgStreamError(IoError),
526+
PgStreamError(io::IoError),
527527
/// The communication channel with the Postgres server has desynchronized
528528
/// due to an earlier communications error.
529529
PgStreamDesynchronized,

src/io.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use openssl::ssl::SslStream;
1+
use openssl::ssl;
22
use std::io::net::ip::Port;
3-
use std::io::net::tcp::TcpStream;
4-
use std::io::net::pipe::UnixStream;
3+
use std::io::net::tcp;
4+
use std::io::net::pipe;
55
use std::io::{Stream, IoResult};
66

77
use {PostgresConnectParams,
@@ -22,7 +22,7 @@ use message::{SslRequest, WriteMessage};
2222
static DEFAULT_PORT: Port = 5432;
2323

2424
pub enum MaybeSslStream<S> {
25-
SslStream(SslStream<S>),
25+
SslStream(ssl::SslStream<S>),
2626
NormalStream(S),
2727
}
2828

@@ -52,8 +52,8 @@ impl<S: Stream> Writer for MaybeSslStream<S> {
5252
}
5353

5454
pub enum InternalStream {
55-
TcpStream(TcpStream),
56-
UnixStream(UnixStream),
55+
TcpStream(tcp::TcpStream),
56+
UnixStream(pipe::UnixStream),
5757
}
5858

5959
impl Reader for InternalStream {
@@ -86,11 +86,11 @@ fn open_socket(params: &PostgresConnectParams)
8686
let port = params.port.unwrap_or(DEFAULT_PORT);
8787
let socket = match params.target {
8888
TargetTcp(ref host) =>
89-
TcpStream::connect(host.as_slice(), port).map(|s| TcpStream(s)),
89+
tcp::TcpStream::connect(host.as_slice(), port).map(|s| TcpStream(s)),
9090
TargetUnix(ref path) => {
9191
let mut path = path.clone();
9292
path.push(format!(".s.PGSQL.{}", port));
93-
UnixStream::connect(&path).map(|s| UnixStream(s))
93+
pipe::UnixStream::connect(&path).map(|s| UnixStream(s))
9494
}
9595
};
9696
socket.map_err(|e| SocketError(e))
@@ -117,7 +117,7 @@ pub fn initialize_stream(params: &PostgresConnectParams, ssl: &SslMode)
117117
}
118118
}
119119

120-
match SslStream::new(ctx, socket) {
120+
match ssl::SslStream::new(ctx, socket) {
121121
Ok(stream) => Ok(SslStream(stream)),
122122
Err(err) => Err(SslError(err))
123123
}

0 commit comments

Comments
 (0)