summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2023-05-15 11:24:09 +0200
committerNeal H. Walfield <neal@pep.foundation>2023-05-15 11:38:01 +0200
commitc9d5e495e4f9c682c22f1b9c02e7679ad97e4637 (patch)
tree4724f76781cd88f8c308ce2efa69f57e2426aaa9
parentd1f7b2ad8ccbbbbd87c70e09924a2d03260519f9 (diff)
openpgp: Derive Clone for SubpacketArea.
- We can safely derive `Clone` for `SubpacketArea`. - There is no reason to not clone the cache as well. It's just a vector.
-rw-r--r--openpgp/src/packet/signature/subpacket.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/openpgp/src/packet/signature/subpacket.rs b/openpgp/src/packet/signature/subpacket.rs
index 2686c32a..22a844dc 100644
--- a/openpgp/src/packet/signature/subpacket.rs
+++ b/openpgp/src/packet/signature/subpacket.rs
@@ -570,6 +570,7 @@ mod tests {
/// # Ok(())
/// # }
/// ```
+#[derive(Clone)]
pub struct SubpacketArea {
/// The subpackets.
packets: Vec<Subpacket>,
@@ -622,12 +623,6 @@ impl Default for SubpacketArea {
}
}
-impl Clone for SubpacketArea {
- fn clone(&self) -> Self {
- Self::new(self.packets.clone()).unwrap()
- }
-}
-
impl PartialEq for SubpacketArea {
fn eq(&self, other: &SubpacketArea) -> bool {
self.cmp(other) == Ordering::Equal