summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse/packet_pile_parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/parse/packet_pile_parser.rs')
-rw-r--r--openpgp/src/parse/packet_pile_parser.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/openpgp/src/parse/packet_pile_parser.rs b/openpgp/src/parse/packet_pile_parser.rs
index 58a93718..223b212b 100644
--- a/openpgp/src/parse/packet_pile_parser.rs
+++ b/openpgp/src/parse/packet_pile_parser.rs
@@ -4,7 +4,6 @@ use std::path::Path;
use crate::{
Result,
Packet,
- Container,
PacketPile,
};
use crate::parse::{
@@ -109,7 +108,7 @@ impl<'a> PacketPileParser<'a> {
-> Result<PacketPileParser<'a>>
{
Ok(PacketPileParser {
- pile: PacketPile { top_level: Container::new() },
+ pile: PacketPile { top_level: Default::default() },
ppr: ppr,
returned_first: false,
})
@@ -135,13 +134,8 @@ impl<'a> PacketPileParser<'a> {
let packets_len = tmp.packets.len();
let p = &mut tmp.packets[packets_len - 1];
if p.children().next().is_none() {
- if i == position - 1 {
- // This is the leaf. Create a new container
- // here.
- p.set_children(Some(Container::new()));
- } else {
- panic!("Internal inconsistency while building message.");
- }
+ assert!(i == position - 1,
+ "Internal inconsistency while building message.");
}
container = p.children_mut().unwrap();