mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-29 11:46:52 +00:00
fix tests
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
This commit is contained in:
parent
a5b0acb378
commit
69c9162558
1 changed files with 6 additions and 2 deletions
|
@ -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…
Reference in a new issue