mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-27 01:33:33 +00:00
Fix clippy warnings (#1385)
## Issue Addressed NA ## Proposed Changes Fixes most clippy warnings and ignores the rest of them, see issue #1388.
This commit is contained in:
@@ -14,6 +14,10 @@ impl HexBytes {
|
||||
pub fn len(&self) -> usize {
|
||||
self.0.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Vec<u8>> for HexBytes {
|
||||
|
||||
@@ -66,7 +66,7 @@ pub enum Prf {
|
||||
impl Prf {
|
||||
pub fn mac(&self, password: &[u8]) -> impl Mac {
|
||||
match &self {
|
||||
_hmac_sha256 => {
|
||||
Prf::HmacSha256 => {
|
||||
Hmac::<Sha256>::new_varkey(password).expect("Could not derive HMAC using SHA256.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,10 +409,10 @@ fn derive_key(password: &[u8], kdf: &Kdf) -> Result<DerivedKey, Error> {
|
||||
password,
|
||||
params.salt.as_bytes(),
|
||||
&ScryptParams::new(log2_int(params.n) as u8, params.r, params.p)
|
||||
.map_err(|e| Error::ScryptInvalidParams(e))?,
|
||||
.map_err(Error::ScryptInvalidParams)?,
|
||||
dk.as_mut_bytes(),
|
||||
)
|
||||
.map_err(|e| Error::ScryptInvaidOutputLen(e))?;
|
||||
.map_err(Error::ScryptInvaidOutputLen)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user