summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet/userid.rs
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2020-12-11 14:41:57 +0100
committerAzul <azul@riseup.net>2020-12-11 18:09:09 +0100
commite3d65e26e284b7a77af9f3b713790f8a98bc417f (patch)
treefc7c363c357f1ce7bd80f5646f4b054f2c468b9b /openpgp/src/packet/userid.rs
parent90105c50559da50d7e601dca6a27040e03e430a1 (diff)
openpgp: Replace `.unwrap()` in doctests with `?`
- See #480.
Diffstat (limited to 'openpgp/src/packet/userid.rs')
-rw-r--r--openpgp/src/packet/userid.rs8
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>