diff options
author | Leonhard Markert <curiousleo@users.noreply.github.com> | 2019-11-10 23:14:13 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-11-15 13:42:52 +0100 |
commit | 9ddabb9b4311a1dcee01df0aaf4b16387312f1e8 (patch) | |
tree | 163fb5d78cd9ed9218e3a5f25e441bbe8b302965 /openpgp | |
parent | 2f65307468e44d603f82d3dc033c11054dc3a772 (diff) |
Fix rustc warnings.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/crypto/aead.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openpgp/src/crypto/aead.rs b/openpgp/src/crypto/aead.rs index 47501d60..ffb99ba0 100644 --- a/openpgp/src/crypto/aead.rs +++ b/openpgp/src/crypto/aead.rs @@ -88,7 +88,7 @@ const AD_PREFIX_LEN: usize = 5; /// A `Read`er for decrypting AEAD-encrypted data. pub struct Decryptor<'a> { // The encrypted data. - source: Box<BufferedReader<Cookie> + 'a>, + source: Box<dyn BufferedReader<Cookie> + 'a>, sym_algo: SymmetricAlgorithm, aead: AEADAlgorithm, @@ -123,7 +123,7 @@ impl<'a> Decryptor<'a> { fn from_buffered_reader(version: u8, sym_algo: SymmetricAlgorithm, aead: AEADAlgorithm, chunk_size: usize, iv: &[u8], key: &SessionKey, - source: Box<'a + BufferedReader<Cookie>>) + source: Box<dyn 'a + BufferedReader<Cookie>>) -> Result<Self> { Ok(Decryptor { @@ -347,7 +347,8 @@ impl<'a> Decryptor<'a> { // Consume the data only on success so that we keep // returning the error. - self.source.consume(chunk.len()); + let chunk_len = chunk.len(); + self.source.consume(chunk_len); } if check_final_tag { @@ -408,7 +409,7 @@ impl<'a> BufferedReaderDecryptor<'a> { /// the `cookie_set` method. pub fn with_cookie(version: u8, sym_algo: SymmetricAlgorithm, aead: AEADAlgorithm, chunk_size: usize, iv: &[u8], - key: &SessionKey, source: Box<BufferedReader<Cookie> + 'a>, + key: &SessionKey, source: Box<dyn BufferedReader<Cookie> + 'a>, cookie: Cookie) -> Result<Self> { |