summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet_pile.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-07-24 15:49:43 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-07-24 16:45:10 +0200
commit0ac1c16d62b7a1900779be513579419f6a0ec730 (patch)
tree29b3c71f21b38c8cff04dd84de93c1dc561d9f33 /openpgp/src/packet_pile.rs
parent14fe75c02b0ae03440d5ba25efe8d1c64119272c (diff)
openpgp: Improve PacketParserResult::as_ref, as_mut, and map.
- Previously, these method withheld information in the EOF case (and in case of `map` this loss is irrecoverable). Fix this by returning a Result instead.
Diffstat (limited to 'openpgp/src/packet_pile.rs')
-rw-r--r--openpgp/src/packet_pile.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/openpgp/src/packet_pile.rs b/openpgp/src/packet_pile.rs
index bb505a96..07ca3561 100644
--- a/openpgp/src/packet_pile.rs
+++ b/openpgp/src/packet_pile.rs
@@ -760,7 +760,7 @@ mod test {
.buffer_unread_content()
.try_into().unwrap();
- while let Some(pp) = ppp.as_ref() {
+ while let Ok(pp) = ppp.as_ref() {
eprintln!("{:?}", pp);
ppp.recurse().unwrap();
}