diff options
author | Azul <azul@riseup.net> | 2020-12-11 14:41:57 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2020-12-11 18:09:09 +0100 |
commit | e3d65e26e284b7a77af9f3b713790f8a98bc417f (patch) | |
tree | fc7c363c357f1ce7bd80f5646f4b054f2c468b9b /openpgp/src/packet/userid.rs | |
parent | 90105c50559da50d7e601dca6a27040e03e430a1 (diff) |
openpgp: Replace `.unwrap()` in doctests with `?`
- See #480.
Diffstat (limited to 'openpgp/src/packet/userid.rs')
-rw-r--r-- | openpgp/src/packet/userid.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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 <boat@example.org>"[..]); + /// # Ok(()) } /// ``` pub fn from_address<O, S>(name: O, comment: O, email: S) -> Result<Self> @@ -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 <ssh://host.example.org>"[..]); + /// # Ok(()) } /// ``` pub fn from_unchecked_address<O, S>(name: O, comment: O, address: S) -> Result<Self> |