Fix some rustc/clippy warnings. (#895)

This commit is contained in:
Toralf Wittner
2019-01-30 15:41:54 +01:00
committed by GitHub
parent a77da73010
commit e23b2733e2
25 changed files with 63 additions and 60 deletions

View File

@ -102,7 +102,7 @@ where
if !self.nonce.is_empty() {
let n = min(data_buf.len(), self.nonce.len());
if &data_buf[.. n] != &self.nonce[.. n] {
if data_buf[.. n] != self.nonce[.. n] {
return Err(SecioError::NonceVerificationFailed)
}
self.nonce.drain(.. n);

View File

@ -549,7 +549,7 @@ where
let (encoding_cipher, encoding_hmac) = {
let (iv, rest) = local_infos.split_at(iv_size);
let (cipher_key, mac_key) = rest.split_at(cipher_key_size);
let hmac = Hmac::from_key(context.state.remote.chosen_hash.into(), mac_key);
let hmac = Hmac::from_key(context.state.remote.chosen_hash, mac_key);
let cipher = ctr(chosen_cipher, cipher_key, iv);
(cipher, hmac)
};
@ -557,7 +557,7 @@ where
let (decoding_cipher, decoding_hmac) = {
let (iv, rest) = remote_infos.split_at(iv_size);
let (cipher_key, mac_key) = rest.split_at(cipher_key_size);
let hmac = Hmac::from_key(context.state.remote.chosen_hash.into(), mac_key);
let hmac = Hmac::from_key(context.state.remote.chosen_hash, mac_key);
let cipher = ctr(chosen_cipher, cipher_key, iv);
(cipher, hmac)
};