diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-07 21:19:38 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-07 21:19:42 +0200 |
commit | 43ccb0caf84df740000195f039685b08809b9b81 (patch) | |
tree | 890d4268be020b763ec65840d14158962322f25a | |
parent | 656768a3bdfd810dbd833a2ef881941c9a886f08 (diff) |
Lint: Do not .clone a Copy type.nora/lint
- https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
-rw-r--r-- | openpgp/src/crypto/aead.rs | 4 | ||||
-rw-r--r-- | openpgp/src/crypto/backend/nettle/aead.rs | 2 | ||||
-rw-r--r-- | openpgp/src/message/lexer.rs | 2 | ||||
-rw-r--r-- | openpgp/src/packet/signature.rs | 2 | ||||
-rw-r--r-- | openpgp/src/parse/stream.rs | 2 | ||||
-rw-r--r-- | sqv/tests/revoked-key.rs | 4 |
6 files changed, 8 insertions, 8 deletions
diff --git a/openpgp/src/crypto/aead.rs b/openpgp/src/crypto/aead.rs index a1d62456..9418d847 100644 --- a/openpgp/src/crypto/aead.rs +++ b/openpgp/src/crypto/aead.rs @@ -76,7 +76,7 @@ impl AEADAlgorithm { EAX => Ok(16), // According to RFC4880bis, Section 5.16.2. OCB => Ok(16), - _ => Err(Error::UnsupportedAEADAlgorithm(self.clone()).into()), + _ => Err(Error::UnsupportedAEADAlgorithm(*self).into()), } } @@ -90,7 +90,7 @@ impl AEADAlgorithm { // least 15 octets long". GnuPG hardcodes 15 in // openpgp_aead_algo_info. OCB => Ok(15), - _ => Err(Error::UnsupportedAEADAlgorithm(self.clone()).into()), + _ => Err(Error::UnsupportedAEADAlgorithm(*self).into()), } } } diff --git a/openpgp/src/crypto/backend/nettle/aead.rs b/openpgp/src/crypto/backend/nettle/aead.rs index f0b70b53..e7ae9d85 100644 --- a/openpgp/src/crypto/backend/nettle/aead.rs +++ b/openpgp/src/crypto/backend/nettle/aead.rs @@ -59,7 +59,7 @@ impl AEADAlgorithm { )), _ => Err(Error::UnsupportedSymmetricAlgorithm(sym_algo).into()), }, - _ => Err(Error::UnsupportedAEADAlgorithm(self.clone()).into()), + _ => Err(Error::UnsupportedAEADAlgorithm(*self).into()), } } } diff --git a/openpgp/src/message/lexer.rs b/openpgp/src/message/lexer.rs index e1ac7194..8e6f8910 100644 --- a/openpgp/src/message/lexer.rs +++ b/openpgp/src/message/lexer.rs @@ -70,7 +70,7 @@ impl<'input> Iterator for Lexer<'input> { type Item = LexerItem<Token, usize, LexicalError>; fn next(&mut self) -> Option<Self::Item> { - let n = self.iter.next().map(|(pos, tok)| (pos, tok.clone())); + let n = self.iter.next().map(|(pos, tok)| (pos, *tok)); if let Some((pos, tok)) = n { Some(Ok((pos, tok, pos))) } else { diff --git a/openpgp/src/packet/signature.rs b/openpgp/src/packet/signature.rs index ef4ae648..dcfb4ea5 100644 --- a/openpgp/src/packet/signature.rs +++ b/openpgp/src/packet/signature.rs @@ -1564,7 +1564,7 @@ impl SignatureBuilder { if ! self.overrode_creation_time { self = // See if we want to backdate the signature. - if let Some(oct) = self.original_creation_time.clone() { + if let Some(oct) = self.original_creation_time { let t = (oct + time::Duration::new(1, 0)).max( time::SystemTime::now() - diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs index d1f66197..26ca706e 100644 --- a/openpgp/src/parse/stream.rs +++ b/openpgp/src/parse/stream.rs @@ -2678,7 +2678,7 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> { IMessageLayer::SignatureGroup { sigs, .. } => { results.new_signature_group(); 'sigs: for sig in sigs.iter_mut() { - let sigid = sig.digest_prefix().clone(); + let sigid = *sig.digest_prefix(); let sig_time = if let Some(t) = sig.signature_creation_time() { t diff --git a/sqv/tests/revoked-key.rs b/sqv/tests/revoked-key.rs index 13a224aa..a2ca1764 100644 --- a/sqv/tests/revoked-key.rs +++ b/sqv/tests/revoked-key.rs @@ -382,7 +382,7 @@ fn create_key() { .set_signature_creation_time(t2).unwrap(); if let Some(r) = reason { - b = b.set_reason_for_revocation(r.clone(), r.to_string().as_bytes()) + b = b.set_reason_for_revocation(*r, r.to_string().as_bytes()) .unwrap(); } @@ -409,7 +409,7 @@ fn create_key() { .set_signature_creation_time(t2).unwrap(); if let Some(r) = reason { - b = b.set_reason_for_revocation(r.clone(), r.to_string().as_bytes()) + b = b.set_reason_for_revocation(*r, r.to_string().as_bytes()) .unwrap(); } |