fix tests

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
pull/167/head
Yoshua Wuyts 5 years ago
parent a5b0acb378
commit 69c9162558
No known key found for this signature in database
GPG Key ID: 24EA8164F96777ED

@ -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;
@ -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()

Loading…
Cancel
Save