@@ -63,7 +63,7 @@ extern crate phf_macros;
6363extern crate "rustc-serialize" as serialize;
6464extern crate time;
6565
66- use openssl:: crypto:: hash:: { HashType , Hasher } ;
66+ use openssl:: crypto:: hash:: { self , Hasher } ;
6767use openssl:: ssl:: { SslContext , MaybeSslStream } ;
6868use serialize:: hex:: ToHex ;
6969use 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
0 commit comments