File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,8 @@ impl<T> Cursor<T> {
108
108
/// # Examples
109
109
///
110
110
/// ```
111
+ /// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
112
+ /// #
111
113
/// use async_std::io::Cursor;
112
114
/// use async_std::io::prelude::*;
113
115
/// use async_std::io::SeekFrom;
@@ -116,11 +118,13 @@ impl<T> Cursor<T> {
116
118
///
117
119
/// assert_eq!(buff.position(), 0);
118
120
///
119
- /// buff.seek(SeekFrom::Current(2)).unwrap() ;
121
+ /// buff.seek(SeekFrom::Current(2)).await? ;
120
122
/// assert_eq!(buff.position(), 2);
121
123
///
122
- /// buff.seek(SeekFrom::Current(-1)).unwrap() ;
124
+ /// buff.seek(SeekFrom::Current(-1)).await? ;
123
125
/// assert_eq!(buff.position(), 1);
126
+ /// #
127
+ /// # Ok(()) }) }
124
128
/// ```
125
129
pub fn position ( & self ) -> u64 {
126
130
self . inner . position ( )
You can’t perform that action at this time.
0 commit comments