diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-03-04 13:26:52 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-03-04 13:26:52 +0100 |
commit | ee1f901b9a0b0cdb7f3ca4fd7cceee0da7144df3 (patch) | |
tree | ea93abc0b71ad874ff4dca743ebbf42377c25df8 | |
parent | 1e9dd698af71f049882726ff7e346f60d76f0583 (diff) |
openpgp: Only print signature stats if we saw some.
-rw-r--r-- | openpgp/examples/statistics.rs | 26 |
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]); + } } } |