Improve documentation for std::io::Cursor#27163
Conversation
src/libstd/io/cursor.rs
Outdated
acbfd77 to
421f45e
Compare
src/libstd/io/cursor.rs
Outdated
There was a problem hiding this comment.
This may want to be rephrased a bit because the primitive types (Vec<u8>, &[u8], etc) already implement I/O traits. The main functionality added by Cursor is the ability to seek.
There was a problem hiding this comment.
i thought they implemented them because they implemented Cursor, though.
421f45e to
6f8ec11
Compare
|
@alexcrichton updated! |
src/libstd/io/cursor.rs
Outdated
There was a problem hiding this comment.
This will need a Seek bound to compile, and you may want to switch to a File instead of a TcpStream (as you can't seek network streams)
There was a problem hiding this comment.
so, the problem with File is that it already implements Seek directly...
There was a problem hiding this comment.
yeah, i'm thinking this just needs to change wholesale. any idea of a good alternate example?
There was a problem hiding this comment.
Oh I think this is a fine example, the function is just generic over Write + Seek and normally you instantiate it with File but in tests you use Cursor<Vec<u8>>
|
kicking this out of the rollup for now |
|
oh wait it's not in it. yay first thing in the morning |
6f8ec11 to
103749d
Compare
Beef up the docs on the type, as well as adding examples for all methods.
|
Okay, updated with a |
…lexcrichton Beef up the docs on the type, as well as adding examples for all methods. r? @alexcrichton
Beef up the docs on the type, as well as adding examples for all
methods.
r? @alexcrichton