diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-11-05 15:04:00 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-11-05 15:40:27 +0100 |
commit | 2e5bf44f1fcbdbcd536064c309b4cbb26b2bc67f (patch) | |
tree | 8ff0b806977af6e620443aa751e4edcf87f048a6 /openpgp/examples | |
parent | 2b3319afa4d646930da7faf836dd8264ea78e6a7 (diff) |
openpgp: Make fields of SubpacketValue private.
Diffstat (limited to 'openpgp/examples')
-rw-r--r-- | openpgp/examples/statistics.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/openpgp/examples/statistics.rs b/openpgp/examples/statistics.rs index e2078bcf..138497e3 100644 --- a/openpgp/examples/statistics.rs +++ b/openpgp/examples/statistics.rs @@ -118,13 +118,13 @@ fn main() { .chain(sig.unhashed_area().iter()) { use crate::openpgp::packet::signature::subpacket::*; - let i = u8::from(sub.tag) as usize; + let i = u8::from(sub.tag()) as usize; sigs_subpacket_tags_count[i] += 1; tpk.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; + [u8::from(sub.tag()) as usize] += 1; } else { sigs_subpacket_tags_size_bytes[i] += len; sigs_subpacket_tags_size_count[i] += 1; @@ -136,7 +136,7 @@ fn main() { sigs_subpacket_tags_size_max[i] = len; } - match sub.value { + match sub.value() { SubpacketValue::Unknown(_) => unreachable!(), SubpacketValue::KeyFlags(k) => if let Some(count) = key_flags.get_mut(&k) { @@ -146,34 +146,34 @@ fn main() { }, SubpacketValue::PreferredSymmetricAlgorithms(a) => - if let Some(count) = p_sym.get_mut(&a) { + if let Some(count) = p_sym.get_mut(a) { *count += 1; } else { p_sym.insert(a.clone(), 1); }, SubpacketValue::PreferredHashAlgorithms(a) => - if let Some(count) = p_hashes.get_mut(&a) { + if let Some(count) = p_hashes.get_mut(a) { *count += 1; } else { p_hashes.insert(a.clone(), 1); }, SubpacketValue::PreferredCompressionAlgorithms(a) => - if let Some(count) = p_comp.get_mut(&a) { + if let Some(count) = p_comp.get_mut(a) { *count += 1; } else { p_comp.insert(a.clone(), 1); }, SubpacketValue::PreferredAEADAlgorithms(a) => - if let Some(count) = p_aead.get_mut(&a) { + if let Some(count) = p_aead.get_mut(a) { *count += 1; } else { p_aead.insert(a.clone(), 1); }, SubpacketValue::ExportableCertification(v) => - if v { + if *v { sigs_subpacket_exportable_true += 1; } else { sigs_subpacket_exportable_false += 1; |