summaryrefslogtreecommitdiffstats
path: root/openpgp/src/keyhandle.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/keyhandle.rs
parent90105c50559da50d7e601dca6a27040e03e430a1 (diff)
openpgp: Replace `.unwrap()` in doctests with `?`
- See #480.
Diffstat (limited to 'openpgp/src/keyhandle.rs')
-rw-r--r--openpgp/src/keyhandle.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/openpgp/src/keyhandle.rs b/openpgp/src/keyhandle.rs
index 5506d700..709b1c93 100644
--- a/openpgp/src/keyhandle.rs
+++ b/openpgp/src/keyhandle.rs
@@ -246,6 +246,7 @@ impl KeyHandle {
/// non-transitive equality relation:
///
/// ```
+ /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> {
/// # use sequoia_openpgp as openpgp;
/// # use openpgp::Fingerprint;
/// # use openpgp::KeyID;
@@ -253,20 +254,21 @@ impl KeyHandle {
/// #
/// # let fpr1 : KeyHandle
/// # = "8F17 7771 18A3 3DDA 9BA4 8E62 AACB 3243 6300 52D9"
- /// # .parse::<Fingerprint>().unwrap().into();
+ /// # .parse::<Fingerprint>()?.into();
/// #
/// # let fpr2 : KeyHandle
/// # = "0123 4567 8901 2345 6789 0123 AACB 3243 6300 52D9"
- /// # .parse::<Fingerprint>().unwrap().into();
+ /// # .parse::<Fingerprint>()?.into();
/// #
- /// # let keyid : KeyHandle = "AACB 3243 6300 52D9".parse::<KeyID>()
- /// # .unwrap().into();
+ /// # let keyid : KeyHandle = "AACB 3243 6300 52D9".parse::<KeyID>()?
+ /// # .into();
/// #
/// // fpr1 and fpr2 are different fingerprints with the same KeyID.
/// assert!(! fpr1.eq(&fpr2));
/// assert!(fpr1.aliases(&keyid));
/// assert!(fpr2.aliases(&keyid));
/// assert!(! fpr1.aliases(&fpr2));
+ /// # Ok(()) }
/// ```
pub fn aliases<H>(&self, other: H) -> bool
where H: Borrow<KeyHandle>