diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-02-26 14:13:19 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-02-26 14:24:32 +0100 |
commit | ffb15aa4567af3152633d07a4598444659a8fbd8 (patch) | |
tree | 290b3393716ead89edeb54d6f6e0bb2e992b4cd4 /openpgp/src/serialize/stream.rs | |
parent | 7196abb880a84c97116fd08ee0d036d2c1792021 (diff) |
openpgp: Add a prelude file to import things related to certificates
- Add `openpgp/src/cert/prelude.rs` to import most types and traits
related to certificates.
- Use it instead of using the types and traits individually.
Diffstat (limited to 'openpgp/src/serialize/stream.rs')
-rw-r--r-- | openpgp/src/serialize/stream.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index 6769a17c..c0f6828e 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -28,7 +28,7 @@ use crate::{ PublicParts, UnspecifiedRole, }, - Cert, + cert::prelude::*, }; use crate::packet::header::CTB; use crate::packet::header::BodyLength; @@ -963,6 +963,7 @@ impl<'a> Encryptor<'a> { /// ``` /// use std::io::Write; /// extern crate sequoia_openpgp as openpgp; + /// use openpgp::cert::prelude::*; /// use openpgp::types::KeyFlags; /// use openpgp::serialize::stream::{ /// Message, Encryptor, LiteralWriter, @@ -974,7 +975,7 @@ impl<'a> Encryptor<'a> { /// # fn f() -> Result<()> { /// let p = &StandardPolicy::new(); /// - /// let cert = openpgp::Cert::from_bytes( + /// let cert = Cert::from_bytes( /// # // We do some acrobatics here to abbreviate the Cert. /// "-----BEGIN PGP PUBLIC KEY BLOCK----- /// @@ -1679,7 +1680,7 @@ mod test { MessageStructure, }, }; - use crate::cert::{CertBuilder, CipherSuite}; + use crate::cert::prelude::*; use crate::serialize::stream::{LiteralWriter, Message}; let (tsk, _) = CertBuilder::new() @@ -1813,7 +1814,7 @@ mod test { fn signature_at_time() { // Generates a signature with a specific Signature Creation // Time. - use crate::cert::{CertBuilder, CipherSuite}; + use crate::cert::prelude::*; use crate::serialize::stream::{LiteralWriter, Message}; use crate::crypto::KeyPair; |