Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yoshua Wuyts <[email protected]>
  • Loading branch information
yoshuawuyts committed Sep 13, 2019
1 parent a5b0acb commit 69c9162
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/io/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ impl<T> Cursor<T> {
/// # 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;
Expand All @@ -116,11 +118,13 @@ impl<T> Cursor<T> {
///
/// 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()
Expand Down

0 comments on commit 69c9162

Please sign in to comment.