diff options
Diffstat (limited to 'openpgp/src/fmt.rs')
-rw-r--r-- | openpgp/src/fmt.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/openpgp/src/fmt.rs b/openpgp/src/fmt.rs index 783c1885..1921a784 100644 --- a/openpgp/src/fmt.rs +++ b/openpgp/src/fmt.rs @@ -40,20 +40,22 @@ pub mod hex { /// # Examples /// /// ```rust - /// use sequoia_openpgp::fmt::hex; + /// # f().unwrap(); fn f() -> sequoia_openpgp::Result<()> { + /// use sequoia_openpgp::fmt::hex; /// /// let mut dumper = hex::Dumper::new(Vec::new(), ""); - /// dumper.write(&[0x89, 0x01, 0x33], "frame").unwrap(); - /// dumper.write(&[0x04], "version").unwrap(); - /// dumper.write(&[0x00], "type").unwrap(); + /// dumper.write(&[0x89, 0x01, 0x33], "frame")?; + /// dumper.write(&[0x04], "version")?; + /// dumper.write(&[0x00], "type")?; /// /// let buf = dumper.into_inner(); /// assert_eq!( - /// ::std::str::from_utf8(&buf[..]).unwrap(), + /// ::std::str::from_utf8(&buf[..])?, /// "00000000 89 01 33 frame\n\ /// 00000003 04 version\n\ /// 00000004 00 type\n\ /// "); + /// # Ok(()) } /// ``` pub struct Dumper<W: io::Write> { inner: W, |