diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-04-27 10:26:07 +0200 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-04-28 11:39:13 +0200 |
commit | 9d4b91098d37549347fdfff9513b629fcd3d973f (patch) | |
tree | ca57b1ef8d2bc7702da081ed6938364859ab7693 /openpgp/src/packet_pile.rs | |
parent | c72e1b0855795d2fcd914157e1bd64c66bd6b997 (diff) |
openpgp: Convert `Cert::from_packet_pile` into `TryFrom`
- Drop `Cert::from_packet_pile`.
- Fixes #462.
Diffstat (limited to 'openpgp/src/packet_pile.rs')
-rw-r--r-- | openpgp/src/packet_pile.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/openpgp/src/packet_pile.rs b/openpgp/src/packet_pile.rs index c8782b76..ff9f981f 100644 --- a/openpgp/src/packet_pile.rs +++ b/openpgp/src/packet_pile.rs @@ -33,6 +33,7 @@ use crate::parse::Cookie; /// /// ```rust /// # extern crate sequoia_openpgp as openpgp; +/// use std::convert::TryFrom; /// use openpgp::{Packet, PacketPile}; /// use openpgp::packet::signature::Signature4; /// use openpgp::packet::Signature; @@ -57,7 +58,7 @@ use crate::parse::Cookie; /// // Certificate is considered revoked because it is accompanied with its /// // revocation signature /// let pp: PacketPile = PacketPile::from_bytes(&buffer)?; -/// let cert = Cert::from_packet_pile(pp)?; +/// let cert = Cert::try_from(pp)?; /// if let Revoked(_) = cert.revocation_status(policy, None) { /// // cert is considered revoked /// } @@ -81,7 +82,7 @@ use crate::parse::Cookie; /// }).into(); /// } /// -/// let cert = Cert::from_packet_pile(pp)?; +/// let cert = Cert::try_from(pp)?; /// if let CouldBe(_) = cert.revocation_status(policy, None) { /// // revocation signature is broken and the key is not definitely revoked /// } |