Skip to content

Commit 69c9162

Browse files
committed
fix tests
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent a5b0acb commit 69c9162

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/io/cursor.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ impl<T> Cursor<T> {
108108
/// # Examples
109109
///
110110
/// ```
111+
/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
112+
/// #
111113
/// use async_std::io::Cursor;
112114
/// use async_std::io::prelude::*;
113115
/// use async_std::io::SeekFrom;
@@ -116,11 +118,13 @@ impl<T> Cursor<T> {
116118
///
117119
/// assert_eq!(buff.position(), 0);
118120
///
119-
/// buff.seek(SeekFrom::Current(2)).unwrap();
121+
/// buff.seek(SeekFrom::Current(2)).await?;
120122
/// assert_eq!(buff.position(), 2);
121123
///
122-
/// buff.seek(SeekFrom::Current(-1)).unwrap();
124+
/// buff.seek(SeekFrom::Current(-1)).await?;
123125
/// assert_eq!(buff.position(), 1);
126+
/// #
127+
/// # Ok(()) }) }
124128
/// ```
125129
pub fn position(&self) -> u64 {
126130
self.inner.position()

0 commit comments

Comments
 (0)