From dd9c712ea95d4b52f8e78a60f53c51452f4c4b60 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 28 Nov 2014 12:24:34 -0800 Subject: [PATCH] Fix for upstream changes --- src/lib.rs | 8 ++++---- src/types/range.rs | 24 ++++++++++++------------ tests/test.rs | 3 ++- tests/types/range.rs | 3 +-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b361ab1a..d5df86ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,7 +67,7 @@ extern crate phf_mac; extern crate log; use url::Url; -use openssl::crypto::hash::{MD5, Hasher}; +use openssl::crypto::hash::{HashType, Hasher}; use openssl::ssl::SslContext; use serialize::hex::ToHex; use std::cell::{Cell, RefCell}; @@ -443,11 +443,11 @@ impl InnerConnection { } AuthenticationMD5Password { salt } => { let pass = try!(user.password.ok_or(ConnectError::MissingPassword)); - let mut hasher = Hasher::new(MD5); + let mut hasher = Hasher::new(HashType::MD5); hasher.update(pass.as_bytes()); hasher.update(user.user.as_bytes()); let output = hasher.finalize()[].to_hex(); - let mut hasher = Hasher::new(MD5); + let mut hasher = Hasher::new(HashType::MD5); hasher.update(output.as_bytes()); hasher.update(&salt); let output = format!("md5{}", hasher.finalize()[].to_hex()); @@ -1560,7 +1560,7 @@ impl<'a> CopyInStatement<'a> { /// /// Returns the number of rows copied. pub fn execute<'b, I, J>(&self, mut rows: I) -> Result - where I: Iterator, J: Iterator<&'b ToSql + 'b> { + where I: Iterator, J: Iterator<&'b (ToSql + 'b)> { let mut conn = self.conn.conn.borrow_mut(); try!(conn.write_messages(&[ diff --git a/src/types/range.rs b/src/types/range.rs index 2a3bc60d..56ec8c55 100644 --- a/src/types/range.rs +++ b/src/types/range.rs @@ -49,50 +49,50 @@ macro_rules! range( ('(', $h:expr ')') => ( ::postgres::types::range::Range::new(None, Some(::postgres::types::range::RangeBound::new($h, - ::postgres::types::range::Exclusive))) + ::postgres::types::range::BoundType::Exclusive))) ); ('(', $h:expr ']') => ( ::postgres::types::range::Range::new(None, Some(::postgres::types::range::RangeBound::new($h, - ::postgres::types::range::Inclusive))) + ::postgres::types::range::BoundType::Inclusive))) ); ('(' $l:expr, ')') => ( ::postgres::types::range::Range::new( Some(::postgres::types::range::RangeBound::new($l, - ::postgres::types::range::Exclusive)), None) + ::postgres::types::range::BoundType::Exclusive)), None) ); ('[' $l:expr, ')') => ( ::postgres::types::range::Range::new( Some(::postgres::types::range::RangeBound::new($l, - ::postgres::types::range::Inclusive)), None) + ::postgres::types::range::BoundType::Inclusive)), None) ); ('(' $l:expr, $h:expr ')') => ( ::postgres::types::range::Range::new( Some(::postgres::types::range::RangeBound::new($l, - ::postgres::types::range::Exclusive)), + ::postgres::types::range::BoundType::Exclusive)), Some(::postgres::types::range::RangeBound::new($h, - ::postgres::types::range::Exclusive))) + ::postgres::types::range::BoundType::Exclusive))) ); ('(' $l:expr, $h:expr ']') => ( ::postgres::types::range::Range::new( Some(::postgres::types::range::RangeBound::new($l, - ::postgres::types::range::Exclusive)), + ::postgres::types::range::BoundType::Exclusive)), Some(::postgres::types::range::RangeBound::new($h, - ::postgres::types::range::Inclusive))) + ::postgres::types::range::BoundType::Inclusive))) ); ('[' $l:expr, $h:expr ')') => ( ::postgres::types::range::Range::new( Some(::postgres::types::range::RangeBound::new($l, - ::postgres::types::range::Inclusive)), + ::postgres::types::range::BoundType::Inclusive)), Some(::postgres::types::range::RangeBound::new($h, - ::postgres::types::range::Exclusive))) + ::postgres::types::range::BoundType::Exclusive))) ); ('[' $l:expr, $h:expr ']') => ( ::postgres::types::range::Range::new( Some(::postgres::types::range::RangeBound::new($l, - ::postgres::types::range::Inclusive)), + ::postgres::types::range::BoundType::Inclusive)), Some(::postgres::types::range::RangeBound::new($h, - ::postgres::types::range::Inclusive))) + ::postgres::types::range::BoundType::Inclusive))) ) ) diff --git a/tests/test.rs b/tests/test.rs index b630c173..a2d95e72 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -6,7 +6,8 @@ extern crate serialize; extern crate url; extern crate openssl; -use openssl::ssl::{SslContext, Sslv3}; +use openssl::ssl::SslContext; +use openssl::ssl::SslMethod::Sslv3; use std::io::timer; use std::time::Duration; diff --git a/tests/types/range.rs b/tests/types/range.rs index b055385e..5c3da724 100644 --- a/tests/types/range.rs +++ b/tests/types/range.rs @@ -2,12 +2,11 @@ use std::i32; use postgres::types::range::{RangeBound, Range, - Inclusive, - Exclusive, UpperBound, LowerBound, Normalizable, BoundType}; +use postgres::types::range::BoundType::{Inclusive, Exclusive}; #[test] fn test_range_bound_lower_lt() {