diff --git a/src/io/cursor.rs b/src/io/cursor.rs index 33a643b..95b13ec 100644 --- a/src/io/cursor.rs +++ b/src/io/cursor.rs @@ -108,6 +108,8 @@ impl Cursor { /// # Examples /// /// ``` + /// # fn main() -> std::io::Result<()> { async_std::task::block_on(async { + /// # /// use async_std::io::Cursor; /// use async_std::io::prelude::*; /// use async_std::io::SeekFrom; @@ -116,11 +118,13 @@ impl Cursor { /// /// assert_eq!(buff.position(), 0); /// - /// buff.seek(SeekFrom::Current(2)).unwrap(); + /// buff.seek(SeekFrom::Current(2)).await?; /// assert_eq!(buff.position(), 2); /// - /// buff.seek(SeekFrom::Current(-1)).unwrap(); + /// buff.seek(SeekFrom::Current(-1)).await?; /// assert_eq!(buff.position(), 1); + /// # + /// # Ok(()) }) } /// ``` pub fn position(&self) -> u64 { self.inner.position()