Skip to content

Commit f680c44

Browse files
committed
Fix for upstream changes
1 parent ffc73e4 commit f680c44

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ phf_codegen = "0.6.11"
2626
[dependencies]
2727
phf = "0.6"
2828
openssl = "0.5"
29-
log = "0.2"
29+
log = "0.3"
3030
rustc-serialize = "0.3"
3131
byteorder = "0.3"
3232

build.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
#![feature(std_misc)]
1+
#![feature(convert)]
22
extern crate phf_codegen;
33

44
use std::env;
55
use std::fs::File;
66
use std::io::{Write, BufWriter};
7-
use std::path::AsPath;
7+
use std::path::Path;
8+
use std::convert::AsRef;
89

910
// From http://www.postgresql.org/docs/9.2/static/errcodes-appendix.html
1011
static SQLSTATES: &'static [(&'static str, &'static str)] = &[
@@ -326,7 +327,9 @@ static SQLSTATES: &'static [(&'static str, &'static str)] = &[
326327
];
327328

328329
fn main() {
329-
let path = env::var_os("OUT_DIR").unwrap().as_path().join("sqlstate.rs");
330+
let path = env::var_os("OUT_DIR").unwrap();
331+
let path: &Path = path.as_ref();
332+
let path = path.join("sqlstate.rs");
330333
let mut file = BufWriter::new(File::create(&path).unwrap());
331334

332335
make_enum(&mut file);

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@
4444
//! ```
4545
#![doc(html_root_url="https://sfackler.github.io/rust-postgres/doc")]
4646
#![feature(unsafe_destructor, io, core, debug_builders, str_char)]
47+
#![cfg_attr(feature = "unix_socket", feature(convert))]
4748
#![warn(missing_docs)]
4849

4950
extern crate byteorder;
5051
#[macro_use]
5152
extern crate log;
5253
extern crate openssl;
5354
extern crate phf;
54-
extern crate "rustc-serialize" as serialize;
55+
extern crate rustc_serialize as serialize;
5556
#[cfg(feature = "unix_socket")]
5657
extern crate unix_socket;
5758

@@ -175,7 +176,7 @@ impl IntoConnectParams for Url {
175176

176177
#[cfg(feature = "unix_socket")]
177178
fn make_unix(maybe_path: String) -> result::Result<ConnectTarget, ConnectError> {
178-
Ok(ConnectTarget::Unix(PathBuf::new(&maybe_path)))
179+
Ok(ConnectTarget::Unix(PathBuf::from(&maybe_path)))
179180
}
180181
#[cfg(not(feature = "unix_socket"))]
181182
fn make_unix(_: String) -> result::Result<ConnectTarget, ConnectError> {
@@ -367,13 +368,12 @@ pub struct CancelData {
367368
/// ## Example
368369
///
369370
/// ```rust,no_run
370-
/// # #![allow(unstable)]
371371
/// # use postgres::{Connection, SslMode};
372-
/// # use std::thread::Thread;
372+
/// # use std::thread;
373373
/// # let url = "";
374374
/// let conn = Connection::connect(url, &SslMode::None).unwrap();
375375
/// let cancel_data = conn.cancel_data();
376-
/// Thread::spawn(move || {
376+
/// thread::spawn(move || {
377377
/// conn.execute("SOME EXPENSIVE QUERY", &[]).unwrap();
378378
/// });
379379
/// # let _ =

src/url.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl Path {
9292
let (path, rest) = try!(get_path(rawpath, false));
9393

9494
// query and fragment
95-
let (query, fragment) = try!(get_query_fragment(rest.as_slice()));
95+
let (query, fragment) = try!(get_query_fragment(&rest));
9696

9797
Ok(Path{ path: path, query: query, fragment: fragment })
9898
}

tests/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#![feature(core, std_misc, thread_sleep)]
1+
#![feature(std_misc, thread_sleep)]
22

33
extern crate postgres;
4-
extern crate "rustc-serialize" as serialize;
4+
extern crate rustc_serialize as serialize;
55
extern crate url;
66
extern crate openssl;
77

@@ -418,7 +418,7 @@ fn test_lazy_query_wrong_conn() {
418418
fn test_param_types() {
419419
let conn = or_panic!(Connection::connect("postgres://postgres@localhost", &SslMode::None));
420420
let stmt = or_panic!(conn.prepare("SELECT $1::INT, $2::VARCHAR"));
421-
assert_eq!(stmt.param_types(), [Type::Int4, Type::Varchar].as_slice());
421+
assert_eq!(stmt.param_types(), &[Type::Int4, Type::Varchar][..]);
422422
}
423423

424424
#[test]

0 commit comments

Comments
 (0)