summaryrefslogtreecommitdiffstats
path: root/openpgp/src/armor.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/armor.rs
parent90105c50559da50d7e601dca6a27040e03e430a1 (diff)
openpgp: Replace `.unwrap()` in doctests with `?`
- See #480.
Diffstat (limited to 'openpgp/src/armor.rs')
-rw-r--r--openpgp/src/armor.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs
index 1ef5d5ef..f2d83c67 100644
--- a/openpgp/src/armor.rs
+++ b/openpgp/src/armor.rs
@@ -18,12 +18,14 @@
//! # Examples
//!
//! ```rust, no_run
+//! # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> {
//! use sequoia_openpgp as openpgp;
//! use std::fs::File;
//! use openpgp::armor::{Reader, ReaderMode, Kind};
//!
-//! let mut file = File::open("somefile.asc").unwrap();
+//! let mut file = File::open("somefile.asc")?;
//! let mut r = Reader::new(&mut file, ReaderMode::Tolerant(Some(Kind::File)));
+//! # Ok(()) }
//! ```
use base64;
@@ -673,7 +675,7 @@ impl<'a> Reader<'a> {
///
/// let mut content = String::new();
/// reader.read_to_string(&mut content)?;
- /// assert_eq!(reader.headers().unwrap(),
+ /// assert_eq!(reader.headers()?,
/// &[("First".into(), "value".into()),
/// ("Header".into(), "value".into())]);
/// # Ok(())