Skip to content
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

Merged
merged 1 commit into from
Jul 22, 2015

Conversation

steveklabnik
Copy link
Member

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.

/// ```
///
/// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/systemcall/system call/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, thanks

@steveklabnik steveklabnik force-pushed the doc_std_io_buf_writer branch from 9b12e54 to 1c380fb Compare July 20, 2015 18:35
/// let reference = buffer.get_mut();
///
/// // we can use reference just like buffer
/// reference.write(&[42]).unwrap();
Copy link
Member

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.

@steveklabnik steveklabnik force-pushed the doc_std_io_buf_writer branch from 1c380fb to eb39df0 Compare July 21, 2015 17:25
@steveklabnik
Copy link
Member Author

@alexcrichton updated!

@alexcrichton
Copy link
Member

@bors: r+ eb39df0

@alexcrichton
Copy link
Member

@bors: rollup

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 21, 2015
… 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.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 21, 2015
… 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.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 22, 2015
… 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.
@steveklabnik steveklabnik force-pushed the doc_std_io_buf_writer branch from eb39df0 to e22c6f7 Compare July 22, 2015 05:21
@steveklabnik
Copy link
Member Author

sigh, it was my fault this time

Mostly through adding examples.
@steveklabnik
Copy link
Member Author

@bors: r=alexcrichton rollup

@bors
Copy link
Contributor

bors commented Jul 22, 2015

📌 Commit e22c6f7 has been approved by alexcrichton

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 22, 2015
… 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.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 22, 2015
… 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.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jul 22, 2015
… 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.
@bors bors merged commit e22c6f7 into rust-lang:master Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants