diff options
author | Azul <azul@riseup.net> | 2020-12-11 18:05:58 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2020-12-11 18:09:09 +0100 |
commit | 9675e949909aef163dea230ad80ee7df1cba1ff8 (patch) | |
tree | 6b89dfd3dd98a1393966ddfd4ec79181bb648397 | |
parent | e3d65e26e284b7a77af9f3b713790f8a98bc417f (diff) |
openpgp: Standardize fn main() in doctests.
- Avoid the additional `fn f()`.
-rw-r--r-- | openpgp/src/armor.rs | 2 | ||||
-rw-r--r-- | openpgp/src/cert.rs | 6 | ||||
-rw-r--r-- | openpgp/src/cert/amalgamation.rs | 6 | ||||
-rw-r--r-- | openpgp/src/cert/amalgamation/iter.rs | 3 | ||||
-rw-r--r-- | openpgp/src/cert/amalgamation/key.rs | 11 | ||||
-rw-r--r-- | openpgp/src/cert/amalgamation/key/iter.rs | 30 | ||||
-rw-r--r-- | openpgp/src/cert/bindings.rs | 15 | ||||
-rw-r--r-- | openpgp/src/cert/parser/mod.rs | 12 | ||||
-rw-r--r-- | openpgp/src/fmt.rs | 2 | ||||
-rw-r--r-- | openpgp/src/keyhandle.rs | 2 | ||||
-rw-r--r-- | openpgp/src/message/mod.rs | 5 | ||||
-rw-r--r-- | openpgp/src/packet/userid.rs | 4 | ||||
-rw-r--r-- | openpgp/src/packet_pile.rs | 21 | ||||
-rw-r--r-- | openpgp/src/serialize.rs | 12 | ||||
-rw-r--r-- | openpgp/src/serialize/cert_armored.rs | 3 | ||||
-rw-r--r-- | openpgp/src/serialize/stream.rs | 74 | ||||
-rw-r--r-- | openpgp/src/serialize/stream/padding.rs | 4 | ||||
-rw-r--r-- | openpgp/src/types/mod.rs | 2 | ||||
-rw-r--r-- | openpgp/src/types/timestamp.rs | 3 |
19 files changed, 89 insertions, 128 deletions
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs index f2d83c67..0d02ecb4 100644 --- a/openpgp/src/armor.rs +++ b/openpgp/src/armor.rs @@ -18,7 +18,7 @@ //! # Examples //! //! ```rust, no_run -//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +//! # fn main() -> sequoia_openpgp::Result<()> { //! use sequoia_openpgp as openpgp; //! use std::fs::File; //! use openpgp::armor::{Reader, ReaderMode, Kind}; diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs index 2755eb7e..2f091c2a 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -612,8 +612,7 @@ use super::*; /// use std::convert::TryFrom; /// use openpgp::cert::prelude::*; /// -/// # fn main() { f().unwrap(); } -/// # fn f() -> Result<()> { +/// # fn main() -> Result<()> { /// fn identity_filter(cert: &Cert) -> Result<Cert> { /// // Iterate over all of the Cert components, pushing packets we /// // want to keep into the accumulator. @@ -689,8 +688,7 @@ use super::*; /// # use openpgp::parse::{Parse, PacketParserResult, PacketParser}; /// use openpgp::Cert; /// -/// # fn main() { f().unwrap(); } -/// # fn f() -> Result<()> { +/// # fn main() -> Result<()> { /// # let ppr = PacketParser::from_bytes(&b""[..])?; /// match Cert::try_from(ppr) { /// Ok(cert) => { diff --git a/openpgp/src/cert/amalgamation.rs b/openpgp/src/cert/amalgamation.rs index 883e024a..701a9f8c 100644 --- a/openpgp/src/cert/amalgamation.rs +++ b/openpgp/src/cert/amalgamation.rs @@ -153,7 +153,7 @@ //! code, which doesn't compile: //! //! ```compile_fail -//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +//! # fn main() -> sequoia_openpgp::Result<()> { //! # use sequoia_openpgp as openpgp; //! use openpgp::cert::prelude::*; //! use openpgp::packet::prelude::*; @@ -188,7 +188,7 @@ //! below for the [`ComponentAmalgamation::component`] method: //! //! ``` -//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +//! # fn main() -> sequoia_openpgp::Result<()> { //! # use sequoia_openpgp as openpgp; //! use openpgp::cert::prelude::*; //! use openpgp::packet::prelude::*; @@ -758,7 +758,7 @@ impl<'a, C> ComponentAmalgamation<'a, C> { /// # Examples /// /// ``` - /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { + /// # fn main() -> sequoia_openpgp::Result<()> { /// # use sequoia_openpgp as openpgp; /// use openpgp::cert::prelude::*; /// use openpgp::packet::prelude::*; diff --git a/openpgp/src/cert/amalgamation/iter.rs b/openpgp/src/cert/amalgamation/iter.rs index bf940845..9e40abde 100644 --- a/openpgp/src/cert/amalgamation/iter.rs +++ b/openpgp/src/cert/amalgamation/iter.rs @@ -341,8 +341,7 @@ impl<'a, C> ValidComponentAmalgamationIter<'a, C> { /// use openpgp::types::RevocationStatus; /// use sequoia_openpgp::policy::StandardPolicy; /// - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// let p = &StandardPolicy::new(); /// /// # let (cert, _) = diff --git a/openpgp/src/cert/amalgamation/key.rs b/openpgp/src/cert/amalgamation/key.rs index d06d1840..f8fbaa01 100644 --- a/openpgp/src/cert/amalgamation/key.rs +++ b/openpgp/src/cert/amalgamation/key.rs @@ -45,7 +45,7 @@ //! vice versa even though we support changing a `KeyBundle`'s role: //! //! ``` -//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +//! # fn main() -> sequoia_openpgp::Result<()> { //! # use std::convert::TryInto; //! # use sequoia_openpgp as openpgp; //! # use openpgp::cert::prelude::*; @@ -89,8 +89,7 @@ //! use openpgp::types::RevocationStatus; //! use sequoia_openpgp::policy::StandardPolicy; //! -//! # fn main() { f().unwrap(); } -//! # fn f() -> Result<()> { +//! # fn main() -> Result<()> { //! # let (cert, _) = //! # CertBuilder::general_purpose(None, Some("alice@example.org")) //! # .generate()?; @@ -148,8 +147,7 @@ //! use openpgp::types::RevocationStatus; //! use sequoia_openpgp::policy::StandardPolicy; //! -//! # fn main() { f().unwrap(); } -//! # fn f() -> Result<()> { +//! # fn main() -> Result<()> { //! let p = &StandardPolicy::new(); //! //! # let (cert, _) = @@ -224,8 +222,7 @@ //! # use openpgp::cert::prelude::*; //! use sequoia_openpgp::policy::StandardPolicy; //! -//! # fn main() { f().unwrap(); } -//! # fn f() -> Result<()> { +//! # fn main() -> Result<()> { //! let p = &StandardPolicy::new(); //! //! # let (cert, _) = diff --git a/openpgp/src/cert/amalgamation/key/iter.rs b/openpgp/src/cert/amalgamation/key/iter.rs index edc98f57..0601c2f0 100644 --- a/openpgp/src/cert/amalgamation/key/iter.rs +++ b/openpgp/src/cert/amalgamation/key/iter.rs @@ -261,8 +261,7 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # use sequoia_openpgp as openpgp; /// # use openpgp::Result; /// # use openpgp::cert::prelude::*; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -298,8 +297,7 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # use sequoia_openpgp as openpgp; /// # use openpgp::Result; /// # use openpgp::cert::prelude::*; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -342,8 +340,7 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # use sequoia_openpgp as openpgp; /// # use openpgp::Result; /// # use openpgp::cert::prelude::*; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -387,8 +384,7 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # use sequoia_openpgp as openpgp; /// # use openpgp::Result; /// # use openpgp::cert::prelude::*; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -459,8 +455,7 @@ impl<'a, P, R> KeyAmalgamationIter<'a, P, R> /// # use openpgp::Result; /// # use openpgp::cert::prelude::*; /// # - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let (cert, _) = CertBuilder::new() /// # .add_signing_subkey() /// # .add_certification_subkey() @@ -1298,8 +1293,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # use openpgp::cert::prelude::*; /// use openpgp::policy::StandardPolicy; /// - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let (cert, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -1356,8 +1350,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # use openpgp::cert::prelude::*; /// use openpgp::policy::StandardPolicy; /// - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// let p = &StandardPolicy::new(); /// /// # let (cert, _) = @@ -1403,8 +1396,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # use openpgp::cert::prelude::*; /// use openpgp::policy::StandardPolicy; /// - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// let p = &StandardPolicy::new(); /// /// # let (cert, _) = @@ -1457,8 +1449,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # use openpgp::cert::prelude::*; /// use openpgp::policy::StandardPolicy; /// - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// let p = &StandardPolicy::new(); /// /// # let (cert, _) = @@ -1506,8 +1497,7 @@ impl<'a, P, R> ValidKeyAmalgamationIter<'a, P, R> /// # use openpgp::cert::prelude::*; /// use openpgp::policy::StandardPolicy; /// - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// let p = &StandardPolicy::new(); /// /// # let (cert, _) = diff --git a/openpgp/src/cert/bindings.rs b/openpgp/src/cert/bindings.rs index 34b99d63..1d1ee3c5 100644 --- a/openpgp/src/cert/bindings.rs +++ b/openpgp/src/cert/bindings.rs @@ -37,8 +37,7 @@ impl<P: key::KeyParts> Key<P, key::SubordinateRole> { /// /// ``` /// # use sequoia_openpgp::{*, packet::prelude::*, types::*, cert::*}; - /// # f().unwrap(); - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// use sequoia_openpgp::policy::StandardPolicy; /// let p = &StandardPolicy::new(); /// @@ -99,8 +98,7 @@ impl UserID { /// /// ``` /// # use sequoia_openpgp::{*, packet::prelude::*, types::*, cert::*}; - /// # f().unwrap(); - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// // Generate a Cert, and create a keypair from the primary key. /// let (cert, _) = CertBuilder::new().generate()?; /// let mut keypair = cert.primary_key().key().clone() @@ -152,8 +150,7 @@ impl UserID { /// /// ``` /// # use sequoia_openpgp::{*, packet::prelude::*, types::*, cert::*}; - /// # f().unwrap(); - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// // Generate a Cert, and create a keypair from the primary key. /// let (alice, _) = CertBuilder::new() /// .set_primary_key_flags(KeyFlags::empty().set_certification()) @@ -231,8 +228,7 @@ impl UserAttribute { /// ``` /// # use sequoia_openpgp::{*, packet::prelude::*, types::*, cert::*, /// # packet::user_attribute::*}; - /// # f().unwrap(); - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// // Generate a Cert, and create a keypair from the primary key. /// let (cert, _) = CertBuilder::new() /// .generate()?; @@ -289,8 +285,7 @@ impl UserAttribute { /// ``` /// # use sequoia_openpgp::{*, packet::prelude::*, types::*, cert::*, /// # packet::user_attribute::*}; - /// # f().unwrap(); - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// // Generate a Cert, and create a keypair from the primary key. /// let (alice, _) = CertBuilder::new() /// .add_userid("alice@example.org") diff --git a/openpgp/src/cert/parser/mod.rs b/openpgp/src/cert/parser/mod.rs index ac7d535c..002f08e3 100644 --- a/openpgp/src/cert/parser/mod.rs +++ b/openpgp/src/cert/parser/mod.rs @@ -432,8 +432,7 @@ impl CertValidator { /// # use openpgp::serialize::Serialize; /// use openpgp::cert::prelude::*; /// -/// # fn main() { f().unwrap(); } -/// # fn f() -> Result<()> { +/// # fn main() -> Result<()> { /// # let (alice, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -478,8 +477,7 @@ impl CertValidator { /// use openpgp::packet::prelude::*; /// use openpgp::types::DataFormat; /// -/// # fn main() { f().unwrap(); } -/// # fn f() -> Result<()> { +/// # fn main() -> Result<()> { /// let mut lit = Literal::new(DataFormat::Text); /// lit.set_body(b"test".to_vec()); /// @@ -646,8 +644,7 @@ impl<'a> CertParser<'a> { /// use openpgp::cert::prelude::*; /// use openpgp::packet::prelude::*; /// - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let (alice, _) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; @@ -734,8 +731,7 @@ impl<'a> CertParser<'a> { /// # use openpgp::parse::{Parse, PacketParser}; /// use openpgp::cert::prelude::*; /// - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let ppr = PacketParser::from_bytes(b"")?; /// # let some_keyid = "C2B819056C652598".parse()?; /// for certr in CertParser::from(ppr) diff --git a/openpgp/src/fmt.rs b/openpgp/src/fmt.rs index 1921a784..5c62d1bd 100644 --- a/openpgp/src/fmt.rs +++ b/openpgp/src/fmt.rs @@ -40,7 +40,7 @@ pub mod hex { /// # Examples /// /// ```rust - /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { + /// # fn main() -> sequoia_openpgp::Result<()> { /// use sequoia_openpgp::fmt::hex; /// /// let mut dumper = hex::Dumper::new(Vec::new(), ""); diff --git a/openpgp/src/keyhandle.rs b/openpgp/src/keyhandle.rs index 709b1c93..e3d56820 100644 --- a/openpgp/src/keyhandle.rs +++ b/openpgp/src/keyhandle.rs @@ -246,7 +246,7 @@ impl KeyHandle { /// non-transitive equality relation: /// /// ``` - /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { + /// # fn main() -> sequoia_openpgp::Result<()> { /// # use sequoia_openpgp as openpgp; /// # use openpgp::Fingerprint; /// # use openpgp::KeyID; diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs index 2fb0daa3..8442cb6d 100644 --- a/openpgp/src/message/mod.rs +++ b/openpgp/src/message/mod.rs @@ -329,7 +329,7 @@ use super::*; /// /// ``` /// # use sequoia_openpgp as openpgp; -/// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +/// # fn main() -> sequoia_openpgp::Result<()> { /// use std::io::Write; /// use openpgp::serialize::stream::{Message, Encryptor, LiteralWriter}; /// @@ -404,8 +404,7 @@ impl Message { /// /// ``` /// # use sequoia_openpgp as openpgp; - /// # fn main() { f().unwrap(); } - /// # fn f() -> openpgp::Result<()> { + /// # fn main() -> openpgp::Result<()> { /// use std::io; /// use std::io::Read; /// use openpgp::Message; diff --git a/openpgp/src/packet/userid.rs b/openpgp/src/packet/userid.rs index 93d6875c..4037f078 100644 --- a/openpgp/src/packet/userid.rs +++ b/openpgp/src/packet/userid.rs @@ -775,7 +775,7 @@ impl UserID { /// [conventional User ID]: #conventional-user-ids /// /// ``` - /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { + /// # fn main() -> sequoia_openpgp::Result<()> { /// # use sequoia_openpgp as openpgp; /// # use openpgp::packet::UserID; /// assert_eq!(UserID::from_address( @@ -810,7 +810,7 @@ impl UserID { /// [conventional User ID]: #conventional-user-ids /// /// ``` - /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { + /// # fn main() -> sequoia_openpgp::Result<()> { /// # use sequoia_openpgp as openpgp; /// # use openpgp::packet::UserID; /// assert_eq!(UserID::from_unchecked_address( diff --git a/openpgp/src/packet_pile.rs b/openpgp/src/packet_pile.rs index 481d09f3..2eb841d0 100644 --- a/openpgp/src/packet_pile.rs +++ b/openpgp/src/packet_pile.rs @@ -57,8 +57,7 @@ use crate::parse::Cookie; /// use openpgp::crypto::mpi; /// use openpgp::types::RevocationStatus::{Revoked, CouldBe}; /// -/// # fn main() { f().unwrap(); } -/// # fn f() -> openpgp::Result<()> { +/// # fn main() -> openpgp::Result<()> { /// let (cert, revocation) = CertBuilder::new().generate()?; /// /// let mut buffer = Vec::new(); @@ -244,8 +243,7 @@ impl PacketPile { /// # use sequoia_openpgp as openpgp; /// # use openpgp::{Result, types::{CompressionAlgorithm, DataFormat}, /// # Packet, PacketPile, packet::Literal, packet::CompressedData}; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let mut lit = Literal::new(DataFormat::Text); /// # lit.set_body(b"test".to_vec()); /// # let packets = vec![lit.into()]; @@ -299,8 +297,7 @@ impl PacketPile { /// # use sequoia_openpgp as openpgp; /// # use openpgp::{Result, types::{CompressionAlgorithm, DataFormat}, /// # Packet, PacketPile, packet::Literal, packet::CompressedData}; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// # let mut lit = Literal::new(DataFormat::Text); /// # lit.set_body(b"test".to_vec()); /// # let packets = vec![lit.into()]; @@ -360,8 +357,7 @@ impl PacketPile { /// # use sequoia_openpgp as openpgp; /// # use openpgp::{Result, types::{CompressionAlgorithm, DataFormat}, /// # Packet, PacketPile, packet::Literal, packet::CompressedData}; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// // A compressed data packet that contains a literal data packet. /// let mut literal = Literal::new(DataFormat::Text); /// literal.set_body(b"old".to_vec()); @@ -448,8 +444,7 @@ impl PacketPile { /// # use openpgp::{Result, types::{CompressionAlgorithm, DataFormat}, /// # Packet, PacketPile, packet::Literal, packet::Tag}; /// # use std::iter::Iterator; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// let mut lit = Literal::new(DataFormat::Text); /// lit.set_body(b"test".to_vec()); /// @@ -471,8 +466,7 @@ impl PacketPile { /// # use sequoia_openpgp as openpgp; /// # use openpgp::{Result, types::{CompressionAlgorithm, DataFormat}, /// # Packet, PacketPile, packet::Literal, packet::CompressedData}; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// let mut lit = Literal::new(DataFormat::Text); /// lit.set_body(b"test".to_vec()); /// @@ -494,8 +488,7 @@ impl PacketPile { /// # use sequoia_openpgp as openpgp; /// # use openpgp::{Result, types::{CompressionAlgorithm, DataFormat}, /// # Packet, PacketPile, packet::Literal, packet::Tag}; - /// # fn main() { f().unwrap(); } - /// # fn f() -> Result<()> { + /// # fn main() -> Result<()> { /// let mut lit = Literal::new(DataFormat::Text); /// lit.set_body(b"test".to_vec()); /// diff --git a/openpgp/src/serialize.rs b/openpgp/src/serialize.rs index 5795183b..b604d9d0 100644 --- a/openpgp/src/serialize.rs +++ b/openpgp/src/serialize.rs @@ -36,7 +36,7 @@ //! [Section 5.9 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.9 //! //! ``` -//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +//! # fn main() -> sequoia_openpgp::Result<()> { //! use std::io::Write; //! use sequoia_openpgp as openpgp; //! use openpgp::serialize::stream::{Message, LiteralWriter}; @@ -82,7 +82,7 @@ //! (see [Section 5.9 of RFC 4880]): //! //! ``` -//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +//! # fn main() -> sequoia_openpgp::Result<()> { //! use sequoia_openpgp as openpgp; //! use openpgp::packet::{Literal, Packet}; //! use openpgp::serialize::{Serialize, SerializeInto}; @@ -115,7 +115,7 @@ //! [`MarshalInto`]: trait.MarshalInto.html //! //! ``` -//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +//! # fn main() -> sequoia_openpgp::Result<()> { //! use sequoia_openpgp as openpgp; //! use openpgp::packet::Literal; //! use openpgp::serialize::{Marshal, MarshalInto}; @@ -195,8 +195,7 @@ const TRACE : bool = false; /// use openpgp::Packet; /// use openpgp::serialize::Serialize; /// -/// # fn main() { f().unwrap(); } -/// # fn f() -> Result<()> { +/// # fn main() -> Result<()> { /// let (_cert, rev) = /// CertBuilder::general_purpose(None, Some("alice@example.org")) /// .generate()?; @@ -220,8 +219,7 @@ const TRACE : bool = false; /// # use openpgp::Packet; /// # use openpgp::serialize::Serialize; /// # -/// # fn main() { f().unwrap(); } -/// # fn f() -> Result<()> { +/// # fn main() -> Result<()> { /// # let (_cert, rev) = /// # CertBuilder::general_purpose(None, Some("alice@example.org")) /// # .generate()?; diff --git a/openpgp/src/serialize/cert_armored.rs b/openpgp/src/serialize/cert_armored.rs index ed673d75..e5f6fa58 100644 --- a/openpgp/src/serialize/cert_armored.rs +++ b/openpgp/src/serialize/cert_armored.rs @@ -74,8 +74,7 @@ impl Cert { /// use openpgp::cert::prelude::*; /// use openpgp::serialize::SerializeInto; /// - /// # f().unwrap(); - /// # fn f() -> openpgp::Result<()> { + /// # fn main() -> openpgp::Result<()> { /// let (cert, _) = /// CertBuilder::general_purpose(None, Some("Mr. Pink ☮☮☮")) /// .generate()?; diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index e69fdd29..2437c7c9 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -57,7 +57,7 @@ //! [Section 5.9 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.9 //! //! ``` -//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { +//! # fn main() -> sequoia_openpgp::Result<()> { //! use std::io::Write; //! use sequoia_openpgp as openpgp; //! use openpgp::serialize::stream::{Message, LiteralWriter}; @@ -80,7 +8 |