summaryrefslogtreecommitdiffstats
path: root/openpgp/src
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2024-05-03 15:02:28 +0200
committerJustus Winter <justus@sequoia-pgp.org>2024-05-29 15:53:49 +0200
commit448dbc12f5fd4bd8d90ef7d9d4d616723b983462 (patch)
tree6a77df6fc9b2bc63c0d1f60d3202fda081265fe3 /openpgp/src
parente7f7361a9030e7b129e61d409b96bea92db2e60b (diff)
openpgp: Allow deconstructing Unknown packets into the parse error.
Diffstat (limited to 'openpgp/src')
-rw-r--r--openpgp/src/packet/unknown.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/openpgp/src/packet/unknown.rs b/openpgp/src/packet/unknown.rs
index 48b7da1e..7216bf19 100644
--- a/openpgp/src/packet/unknown.rs
+++ b/openpgp/src/packet/unknown.rs
@@ -153,6 +153,11 @@ impl Unknown {
::std::mem::replace(&mut self.error, error)
}
+ /// Returns the error.
+ pub fn into_error(self) -> anyhow::Error {
+ self.error
+ }
+
/// Best effort Ord implementation.
///
/// The Cert canonicalization needs to order Unknown packets.