From e3d65e26e284b7a77af9f3b713790f8a98bc417f Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 11 Dec 2020 14:41:57 +0100 Subject: openpgp: Replace `.unwrap()` in doctests with `?` - See #480. --- openpgp/src/packet/userid.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'openpgp/src/packet/userid.rs') diff --git a/openpgp/src/packet/userid.rs b/openpgp/src/packet/userid.rs index 49d189bf..93d6875c 100644 --- a/openpgp/src/packet/userid.rs +++ b/openpgp/src/packet/userid.rs @@ -775,12 +775,14 @@ impl UserID { /// [conventional User ID]: #conventional-user-ids /// /// ``` + /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { /// # use sequoia_openpgp as openpgp; /// # use openpgp::packet::UserID; /// assert_eq!(UserID::from_address( /// "John Smith".into(), - /// None, "boat@example.org").unwrap().value(), + /// None, "boat@example.org")?.value(), /// &b"John Smith "[..]); + /// # Ok(()) } /// ``` pub fn from_address(name: O, comment: O, email: S) -> Result @@ -808,12 +810,14 @@ impl UserID { /// [conventional User ID]: #conventional-user-ids /// /// ``` + /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { /// # use sequoia_openpgp as openpgp; /// # use openpgp::packet::UserID; /// assert_eq!(UserID::from_unchecked_address( /// "NAS".into(), - /// None, "ssh://host.example.org").unwrap().value(), + /// None, "ssh://host.example.org")?.value(), /// &b"NAS "[..]); + /// # Ok(()) } /// ``` pub fn from_unchecked_address(name: O, comment: O, address: S) -> Result -- cgit v1.2.3