Skip to content

Commit 9df10b9

Browse files
committed
Fix for upstream changes
1 parent 9a5f751 commit 9df10b9

3 files changed

Lines changed: 14 additions & 15 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ default = ["uuid"]
2525
[dependencies]
2626
phf = "0.6"
2727
phf_macros = "0.6"
28-
openssl = "0.2.16"
28+
openssl = "0.3.0"
2929
time = "0.1.14"
3030
log = "0.2"
3131
rustc-serialize = "0.2"

src/lib.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extern crate phf_macros;
6363
extern crate "rustc-serialize" as serialize;
6464
extern crate time;
6565

66-
use openssl::crypto::hash::{HashType, Hasher};
66+
use openssl::crypto::hash::{self, Hasher};
6767
use openssl::ssl::{SslContext, MaybeSslStream};
6868
use serialize::hex::ToHex;
6969
use std::borrow::ToOwned;
@@ -493,7 +493,7 @@ impl InnerConnection {
493493

494494
fn write_messages(&mut self, messages: &[FrontendMessage]) -> IoResult<()> {
495495
debug_assert!(!self.desynchronized);
496-
for message in messages.iter() {
496+
for message in messages {
497497
try_desync!(self, self.stream.write_message(message));
498498
}
499499
Ok(try_desync!(self, self.stream.flush()))
@@ -550,14 +550,13 @@ impl InnerConnection {
550550
}
551551
AuthenticationMD5Password { salt } => {
552552
let pass = try!(user.password.ok_or(ConnectError::MissingPassword));
553-
let mut hasher = Hasher::new(HashType::MD5);
554-
hasher.update(pass.as_bytes());
555-
hasher.update(user.user.as_bytes());
556-
let output = hasher.finalize().to_hex();
557-
let mut hasher = Hasher::new(HashType::MD5);
558-
hasher.update(output.as_bytes());
559-
hasher.update(&salt);
560-
let output = format!("md5{}", hasher.finalize().to_hex());
553+
let mut hasher = Hasher::new(hash::Type::MD5);
554+
let _ = hasher.write_all(pass.as_bytes());
555+
let _ = hasher.write_all(user.user.as_bytes());
556+
let output = hasher.finish().to_hex();
557+
let _ = hasher.write_all(output.as_bytes());
558+
let _ = hasher.write_all(&salt);
559+
let output = format!("md5{}", hasher.finish().to_hex());
561560
try!(self.write_messages(&[PasswordMessage {
562561
password: &output
563562
}]));
@@ -618,12 +617,12 @@ impl InnerConnection {
618617
try!(self.wait_for_ready());
619618

620619
let mut param_types = vec![];
621-
for oid in raw_param_types.into_iter() {
620+
for oid in raw_param_types {
622621
param_types.push(try!(self.get_type(oid)));
623622
}
624623

625624
let mut result_desc = vec![];
626-
for RowDescriptionEntry { name, type_oid, .. } in raw_result_desc.into_iter() {
625+
for RowDescriptionEntry { name, type_oid, .. } in raw_result_desc {
627626
result_desc.push(ResultDescription {
628627
name: name,
629628
ty: try!(self.get_type(type_oid)),
@@ -1861,7 +1860,7 @@ impl<'a> CopyInStatement<'a> {
18611860
/// set in memory.
18621861
///
18631862
/// Returns the number of rows copied.
1864-
pub fn execute<I, J>(&self, mut rows: I) -> Result<usize>
1863+
pub fn execute<I, J>(&self, rows: I) -> Result<usize>
18651864
where I: Iterator<Item=J>, J: StreamIterator {
18661865
let mut conn = self.conn.conn.borrow_mut();
18671866

src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::old_io::IoResult;
22

3-
pub fn comma_join<'a, W, I>(writer: &mut W, mut strs: I) -> IoResult<()>
3+
pub fn comma_join<'a, W, I>(writer: &mut W, strs: I) -> IoResult<()>
44
where W: Writer, I: Iterator<Item=&'a str> {
55
let mut first = true;
66
for str_ in strs {

0 commit comments

Comments
 (0)