Fixed multiple clippy warnings.
This commit is contained in:
@@ -23,12 +23,12 @@ impl Chacha {
|
||||
}
|
||||
|
||||
pub fn encrypt(&self, data: &[u8]) -> Result<Vec<u8>, Error> {
|
||||
let nonce = Nonce::from(self.nonce.clone());
|
||||
let nonce = Nonce::from(self.nonce);
|
||||
self.cipher.encrypt(&nonce, data.as_ref())
|
||||
}
|
||||
|
||||
pub fn decrypt(&self, data: &[u8]) -> Result<Vec<u8>, Error> {
|
||||
let nonce = Nonce::from(self.nonce.clone());
|
||||
let nonce = Nonce::from(self.nonce);
|
||||
self.cipher.decrypt(&nonce, data.as_ref())
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ impl CryptoBox {
|
||||
|
||||
pub fn decrypt(secret: &[u8], message: &[u8]) -> Result<Vec<u8>, Error> {
|
||||
let secret = SecretKey::from_bytes(secret).unwrap();
|
||||
decrypt(&secret, &message)
|
||||
decrypt(&secret, message)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user