-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve documentation for std::io::BufWriter #27155
Conversation
/// ``` | ||
/// | ||
/// Because we're not buffering, we write each one in turn, incurring the | ||
/// overhead of a systemcall per byte written. We can fix this with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/systemcall/system call/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch, thanks
9b12e54
to
1c380fb
Compare
/// let reference = buffer.get_mut(); | ||
/// | ||
/// // we can use reference just like buffer | ||
/// reference.write(&[42]).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may want to be a slightly different example, the warning above indicates that this should not be done (bypassing the buffer), so it seems somewhat odd to turn around and call this.
It may be best to either update the comment here just leave it at let reference
like the above example.
1c380fb
to
eb39df0
Compare
@alexcrichton updated! |
@bors: rollup |
… r=alexcrichton Mostly through adding examples. r? @alexcrichton I'm going to be doing a bunch of these today, but I figured I'd keep it one PR per struct, since the last 'all the things in one PR' ended up taking a week to actually land.
… r=alexcrichton Mostly through adding examples. r? @alexcrichton I'm going to be doing a bunch of these today, but I figured I'd keep it one PR per struct, since the last 'all the things in one PR' ended up taking a week to actually land.
… r=alexcrichton Mostly through adding examples. r? @alexcrichton I'm going to be doing a bunch of these today, but I figured I'd keep it one PR per struct, since the last 'all the things in one PR' ended up taking a week to actually land.
eb39df0
to
e22c6f7
Compare
sigh, it was my fault this time |
Mostly through adding examples.
@bors: r=alexcrichton rollup |
📌 Commit e22c6f7 has been approved by |
… r=alexcrichton Mostly through adding examples. r? @alexcrichton I'm going to be doing a bunch of these today, but I figured I'd keep it one PR per struct, since the last 'all the things in one PR' ended up taking a week to actually land.
… r=alexcrichton Mostly through adding examples. r? @alexcrichton I'm going to be doing a bunch of these today, but I figured I'd keep it one PR per struct, since the last 'all the things in one PR' ended up taking a week to actually land.
… r=alexcrichton Mostly through adding examples. r? @alexcrichton I'm going to be doing a bunch of these today, but I figured I'd keep it one PR per struct, since the last 'all the things in one PR' ended up taking a week to actually land.
Mostly through adding examples.
r? @alexcrichton
I'm going to be doing a bunch of these today, but I figured I'd keep it one PR per struct, since the last 'all the things in one PR' ended up taking a week to actually land.