summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse/packet_pile_parser.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-04-09 17:29:50 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-04-09 18:18:18 +0200
commitc1516c59709fa47d13100daddb57657008a793c3 (patch)
tree25a93149cd56546cdff6b383288cffc0b82941a1 /openpgp/src/parse/packet_pile_parser.rs
parentdbaf698a597a018d9522e8025e9b56e784f0d60b (diff)
openpgp: Remove convenience functions.
Diffstat (limited to 'openpgp/src/parse/packet_pile_parser.rs')
-rw-r--r--openpgp/src/parse/packet_pile_parser.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/openpgp/src/parse/packet_pile_parser.rs b/openpgp/src/parse/packet_pile_parser.rs
index 9c568a25..b0a7b97b 100644
--- a/openpgp/src/parse/packet_pile_parser.rs
+++ b/openpgp/src/parse/packet_pile_parser.rs
@@ -160,10 +160,11 @@ impl<'a> PacketPileParser<'a> {
if self.returned_first {
match self.ppr.take() {
PacketParserResult::Some(pp) => {
+ let recursion_depth = pp.recursion_depth();
let (packet, ppr) = pp.recurse()?;
self.insert_packet(
packet,
- ppr.last_recursion_depth().unwrap() as isize);
+ recursion_depth as isize);
self.ppr = ppr;
}
eof @ PacketParserResult::EOF(_) => {
@@ -189,10 +190,11 @@ impl<'a> PacketPileParser<'a> {
if self.returned_first {
match self.ppr.take() {
PacketParserResult::Some(pp) => {
+ let recursion_depth = pp.recursion_depth();
let (packet, ppr) = pp.next()?;
self.insert_packet(
packet,
- ppr.last_recursion_depth().unwrap() as isize);
+ recursion_depth as isize);
self.ppr = ppr;
},
eof @ PacketParserResult::EOF(_) => {