summaryrefslogtreecommitdiffstats
path: root/tool/src/commands
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 /tool/src/commands
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 'tool/src/commands')
-rw-r--r--tool/src/commands/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs
index 32239d8d..04e84987 100644
--- a/tool/src/commands/mod.rs
+++ b/tool/src/commands/mod.rs
@@ -428,7 +428,7 @@ pub fn split(input: &mut dyn io::Read, prefix: &str)
let old_depth = Some(pp.recursion_depth());
ppr = pp.recurse()?.1;
- let new_depth = ppr.as_ref().map(|pp| pp.recursion_depth());
+ let new_depth = ppr.as_ref().map(|pp| pp.recursion_depth()).ok();
// Update pos.
match old_depth.cmp(&new_depth) {