Skip to content

Commit ccdb02f

Browse files
committed
Strip prefixes from types
They can be prefixed with the crate name
1 parent 44da9d9 commit ccdb02f

8 files changed

Lines changed: 270 additions & 284 deletions

File tree

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ path = "tests/test.rs"
1414

1515
[dependencies.openssl]
1616
git = "https://github.com/sfackler/rust-openssl"
17-
rev = "39343df472b4b0c99055d371f42beceeef527bd6"
17+
rev = "182ec4a6e77a53381e8b5e161f5d9c8fb3d965ff"
1818

1919
[dependencies.phf]
2020
git = "https://github.com/sfackler/rust-phf"
21-
rev = "b2220d9a428049fb9c52b51c16d8f6b15cd02487"
21+
rev = "9fd8d24f59b1af976526fc43baf6635a3714c71e"
2222

2323
[dependencies.phf_mac]
2424
git = "https://github.com/sfackler/rust-phf"
25-
rev = "b2220d9a428049fb9c52b51c16d8f6b15cd02487"
25+
rev = "9fd8d24f59b1af976526fc43baf6635a3714c71e"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern crate time;
1515

1616
use time::Timespec;
1717

18-
use postgres::{PostgresConnection, NoSsl};
18+
use postgres::NoSsl;
1919
use postgres::types::ToSql;
2020

2121
struct Person {
@@ -26,8 +26,8 @@ struct Person {
2626
}
2727

2828
fn main() {
29-
let conn = PostgresConnection::connect("postgres://postgres@localhost",
30-
&NoSsl).unwrap();
29+
let conn = postgres::Connection::connect("postgres://postgres@localhost",
30+
&NoSsl).unwrap();
3131

3232
conn.execute("CREATE TABLE person (
3333
id SERIAL PRIMARY KEY,

src/io.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::io::net::tcp::TcpStream;
44
use std::io::net::unix::UnixStream;
55
use std::io::{Stream, IoResult};
66

7-
use {PostgresConnectParams,
7+
use {ConnectParams,
88
SslMode,
99
NoSsl,
1010
PreferSsl,
@@ -81,8 +81,7 @@ impl Writer for InternalStream {
8181
}
8282
}
8383

84-
fn open_socket(params: &PostgresConnectParams)
85-
-> Result<InternalStream, PostgresConnectError> {
84+
fn open_socket(params: &ConnectParams) -> Result<InternalStream, PostgresConnectError> {
8685
let port = params.port.unwrap_or(DEFAULT_PORT);
8786
let socket = match params.target {
8887
TargetTcp(ref host) =>
@@ -96,7 +95,7 @@ fn open_socket(params: &PostgresConnectParams)
9695
socket.map_err(|e| SocketError(e))
9796
}
9897

99-
pub fn initialize_stream(params: &PostgresConnectParams, ssl: &SslMode)
98+
pub fn initialize_stream(params: &ConnectParams, ssl: &SslMode)
10099
-> Result<MaybeSslStream<InternalStream>, PostgresConnectError> {
101100
let mut socket = try!(open_socket(params));
102101

0 commit comments

Comments
 (0)