File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 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> {
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 ( )
You can’t perform that action at this time.
0 commit comments