summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openpgp/src/packet/signature/subpacket.rs2
-rw-r--r--openpgp/src/serialize.rs6
-rw-r--r--openpgp/src/types/mod.rs16
-rw-r--r--sq/src/commands/dump.rs2
4 files changed, 13 insertions, 13 deletions
diff --git a/openpgp/src/packet/signature/subpacket.rs b/openpgp/src/packet/signature/subpacket.rs
index ed7fd57e..2d09615a 100644
--- a/openpgp/src/packet/signature/subpacket.rs
+++ b/openpgp/src/packet/signature/subpacket.rs
@@ -430,7 +430,7 @@ mod tests {
use super::*;
quickcheck! {
fn roundtrip(tag: SubpacketTag) -> bool {
- let val: u8 = tag.clone().into();
+ let val: u8 = tag.into();
tag == SubpacketTag::from(val)
}
}
diff --git a/openpgp/src/serialize.rs b/openpgp/src/serialize.rs
index 1f1f4f89..08b9cc40 100644
--- a/openpgp/src/serialize.rs
+++ b/openpgp/src/serialize.rs
@@ -1395,9 +1395,9 @@ impl Marshal for SubpacketValue {
use self::SubpacketValue::*;
match self {
SignatureCreationTime(t) =>
- write_be_u32(o, t.clone().into())?,
+ write_be_u32(o, (*t).into())?,
SignatureExpirationTime(t) =>
- write_be_u32(o, t.clone().into())?,
+ write_be_u32(o, (*t).into())?,
ExportableCertification(e) =>
o.write_all(&[if *e { 1 } else { 0 }])?,
TrustSignature { ref level, ref trust } =>
@@ -1409,7 +1409,7 @@ impl Marshal for SubpacketValue {
Revocable(r) =>
o.write_all(&[if *r { 1 } else { 0 }])?,
KeyExpirationTime(t) =>
- write_be_u32(o, t.clone().into())?,
+ write_be_u32(o, (*t).into())?,
PreferredSymmetricAlgorithms(ref p) =>
for a in p {
o.write_all(&[(*a).into()])?;
diff --git a/openpgp/src/types/mod.rs b/openpgp/src/types/mod.rs
index e5d5c5e6..9eac14d2 100644
--- a/openpgp/src/types/mod.rs
+++ b/openpgp/src/types/mod.rs
@@ -1712,7 +1712,7 @@ mod tests {
quickcheck! {
fn comp_roundtrip(comp: CompressionAlgorithm) -> bool {
- let val: u8 = comp.clone().into();
+ let val: u8 = comp.into();
comp == CompressionAlgorithm::from(val)
}
}
@@ -1737,7 +1737,7 @@ mod tests {
quickcheck! {
fn sym_roundtrip(sym: SymmetricAlgorithm) -> bool {
- let val: u8 = sym.clone().into();
+ let val: u8 = sym.into();
sym == SymmetricAlgorithm::from(val)
}
}
@@ -1764,7 +1764,7 @@ mod tests {
quickcheck! {
fn aead_roundtrip(aead: AEADAlgorithm) -> bool {
- let val: u8 = aead.clone().into();
+ let val: u8 = aead.into();
aead == AEADAlgorithm::from(val)
}
}
@@ -1791,7 +1791,7 @@ mod tests {
quickcheck! {
fn pk_roundtrip(pk: PublicKeyAlgorithm) -> bool {
- let val: u8 = pk.clone().into();
+ let val: u8 = pk.into();
pk == PublicKeyAlgorithm::from(val)
}
}
@@ -1825,7 +1825,7 @@ mod tests {
quickcheck! {
fn signature_type_roundtrip(t: SignatureType) -> bool {
- let val: u8 = t.clone().into();
+ let val: u8 = t.into();
t == SignatureType::from(val)
}
}
@@ -1840,7 +1840,7 @@ mod tests {
quickcheck! {
fn hash_roundtrip(hash: HashAlgorithm) -> bool {
- let val: u8 = hash.clone().into();
+ let val: u8 = hash.into();
hash == HashAlgorithm::from(val)
}
}
@@ -1889,7 +1889,7 @@ mod tests {
quickcheck! {
fn rfr_roundtrip(rfr: ReasonForRevocation) -> bool {
- let val: u8 = rfr.clone().into();
+ let val: u8 = rfr.into();
rfr == ReasonForRevocation::from(val)
}
}
@@ -1917,7 +1917,7 @@ mod tests {
quickcheck! {
fn df_roundtrip(df: DataFormat) -> bool {
- let val: u8 = df.clone().into();
+ let val: u8 = df.into();
df == DataFormat::from(val)
}
}
diff --git a/sq/src/commands/dump.rs b/sq/src/commands/dump.rs
index 003657ba..a9aae2cc 100644
--- a/sq/src/commands/dump.rs
+++ b/sq/src/commands/dump.rs
@@ -772,7 +772,7 @@ impl PacketDumper {
write!(output, "{} Signature expiration time: {} ({})",
i, t.convert(),
if let Some(creation) = sig.signature_creation_time() {
- (creation + t.clone().into()).convert().to_string()
+ (creation + (*t).into()).convert().to_string()
} else {
" (no Signature Creation Time subpacket)".into()
})?,