@@ -14,12 +14,13 @@ use core::convert::TryInto;
14
14
use cmp;
15
15
use io:: { self , Initializer , SeekFrom , Error , ErrorKind } ;
16
16
17
- /// A `Cursor` wraps another type and provides it with a
17
+ /// A `Cursor` wraps an in-memory buffer and provides it with a
18
18
/// [`Seek`] implementation.
19
19
///
20
- /// `Cursor`s are typically used with in-memory buffers to allow them to
21
- /// implement [`Read`] and/or [`Write`], allowing these buffers to be used
22
- /// anywhere you might use a reader or writer that does actual I/O.
20
+ /// `Cursor`s are used with in-memory buffers, anything implementing
21
+ /// `AsRef<[u8]>`, to allow them to implement [`Read`] and/or [`Write`],
22
+ /// allowing these buffers to be used anywhere you might use a reader or writer
23
+ /// that does actual I/O.
23
24
///
24
25
/// The standard library implements some I/O traits on various types which
25
26
/// are commonly used as a buffer, like `Cursor<`[`Vec`]`<u8>>` and
@@ -87,11 +88,11 @@ pub struct Cursor<T> {
87
88
}
88
89
89
90
impl < T > Cursor < T > {
90
- /// Creates a new cursor wrapping the provided underlying I/O object .
91
+ /// Creates a new cursor wrapping the provided underlying in-memory buffer .
91
92
///
92
- /// Cursor initial position is `0` even if underlying object (e.
93
- /// g. `Vec`) is not empty. So writing to cursor starts with
94
- /// overwriting `Vec` content, not with appending to it.
93
+ /// Cursor initial position is `0` even if underlying buffer (e.g. `Vec`)
94
+ /// is not empty. So writing to cursor starts with overwriting `Vec`
95
+ /// content, not with appending to it.
95
96
///
96
97
/// # Examples
97
98
///
0 commit comments