diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-01-02 13:55:29 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-01-02 14:00:24 +0100 |
commit | 61c3c3bfe300b2cf638a1d9dd7985526ea4c23b0 (patch) | |
tree | 576a273df1079c074be1234adedb1a1d52e7a74b /openpgp/examples/statistics.rs | |
parent | 2ea47f61ef6aca4097d7abba850dc4ba6a9018be (diff) |
openpgp: Change SubpacketValue::Unknown to store the tag.
- Makes it possible to construct unknown packets with arbitrary
subpacket tags.
- Fixes a regression.
Diffstat (limited to 'openpgp/examples/statistics.rs')
-rw-r--r-- | openpgp/examples/statistics.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/openpgp/examples/statistics.rs b/openpgp/examples/statistics.rs index 0b453467..c990fb58 100644 --- a/openpgp/examples/statistics.rs +++ b/openpgp/examples/statistics.rs @@ -149,7 +149,7 @@ fn main() { sigs_subpacket_tags_count[i] += 1; cert.sigs_subpacket_tags_count[i] += 1; signature.subpacket_tags_count[i] += 1; - if let SubpacketValue::Unknown(_) = sub.value() { + if let SubpacketValue::Unknown { .. } = sub.value() { sigs_subpacket_tags_unknown [u8::from(sub.tag()) as usize] += 1; } else { @@ -165,7 +165,8 @@ fn main() { } match sub.value() { - SubpacketValue::Unknown(_) => unreachable!(), + SubpacketValue::Unknown { .. } => + unreachable!(), SubpacketValue::KeyFlags(k) => if let Some(count) = key_flags.get_mut(&k) { *count += 1; |