More cleanup

This commit is contained in:
Steven Fackler
2015-12-29 15:16:15 -07:00
parent 487cbaf9c2
commit ccfba62b99
3 changed files with 6 additions and 6 deletions

View File

@@ -570,12 +570,12 @@ impl InnerConnection {
AuthenticationMD5Password { salt } => {
let pass = try!(user.password.ok_or(ConnectError::MissingPassword));
let mut hasher = Md5::new();
let _ = hasher.input(pass.as_bytes());
let _ = hasher.input(user.user.as_bytes());
hasher.input(pass.as_bytes());
hasher.input(user.user.as_bytes());
let output = hasher.result_str();
hasher.reset();
let _ = hasher.input(output.as_bytes());
let _ = hasher.input(&salt);
hasher.input(output.as_bytes());
hasher.input(&salt);
let output = format!("md5{}", hasher.result_str());
try!(self.write_messages(&[PasswordMessage { password: &output }]));
}

View File

@@ -170,7 +170,7 @@ pub fn initialize_stream(params: &ConnectParams,
try!(socket.write_message(&SslRequest { code: message::SSL_CODE }));
try!(socket.flush());
if try!(socket.read_u8()) == 'N' as u8 {
if try!(socket.read_u8()) == b'N' {
if ssl_required {
return Err(ConnectError::NoSslSupport);
} else {

View File

@@ -62,7 +62,7 @@ impl<'a, T: 'a + ToSql> ToSql for Slice<'a, T> {
fn accepts(ty: &Type) -> bool {
match ty.kind() {
&Kind::Array(ref member) => <T as ToSql>::accepts(member),
&Kind::Array(ref member) => T::accepts(member),
_ => false,
}
}