summaryrefslogtreecommitdiffstats
path: root/openpgp/examples/statistics.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-03-04 13:26:52 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-03-04 13:26:52 +0100
commitee1f901b9a0b0cdb7f3ca4fd7cceee0da7144df3 (patch)
treeea93abc0b71ad874ff4dca743ebbf42377c25df8 /openpgp/examples/statistics.rs
parent1e9dd698af71f049882726ff7e346f60d76f0583 (diff)
openpgp: Only print signature stats if we saw some.
Diffstat (limited to 'openpgp/examples/statistics.rs')
-rw-r--r--openpgp/examples/statistics.rs26
1 files changed, 14 insertions, 12 deletions
diff --git a/openpgp/examples/statistics.rs b/openpgp/examples/statistics.rs
index c1c3c33a..c5749621 100644
--- a/openpgp/examples/statistics.rs
+++ b/openpgp/examples/statistics.rs
@@ -155,19 +155,21 @@ fn main() {
tags_size_bytes[t]);
}
}
- println!();
- println!("# Signature statistics");
- println!();
- println!("{:>22} {:>9}",
- "", "count",);
- println!("--------------------------------");
- for t in 0..256 {
- let max = tpk_max.sigs[t];
- if max > 0 {
- println!("{:>22} {:>9}",
- format!("{:?}", SignatureType::from(t as u8)),
- sigs_count[t]);
+ if tags_count[u8::from(Tag::Signature) as usize] > 0 {
+ println!();
+ println!("# Signature statistics");
+ println!();
+ println!("{:>22} {:>9}",
+ "", "count",);
+ println!("--------------------------------");
+ for t in 0..256 {
+ let max = tpk_max.sigs[t];
+ if max > 0 {
+ println!("{:>22} {:>9}",
+ format!("{:?}", SignatureType::from(t as u8)),
+ sigs_count[t]);
+ }
}
}