Skip to content

Fix example for BufferedReader#18374

Merged
bors merged 1 commit into
rust-lang:masterfrom
steveklabnik:gh18197
Oct 30, 2014
Merged

Fix example for BufferedReader#18374
bors merged 1 commit into
rust-lang:masterfrom
steveklabnik:gh18197

Conversation

@steveklabnik

Copy link
Copy Markdown
Contributor

Fixes #18197

Comment thread src/libstd/io/buffered.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a .unwrap() here too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does it need it? This example works as-is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It works because we have a sketchy (IMO) impl<E> Stream for Result<Stream, E>

@steveklabnik

Copy link
Copy Markdown
Contributor Author

@sfackler done

Comment thread src/libstd/io/buffered.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, sorry, I was looking for this to end up on the call to File::create, not BufferedWriter::new.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

whoops! duh.

@steveklabnik

Copy link
Copy Markdown
Contributor Author

updated!

bors added a commit that referenced this pull request Oct 30, 2014
@bors bors closed this Oct 30, 2014
@bors bors merged commit 72fb8f3 into rust-lang:master Oct 30, 2014
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.

Doc's example code for BufferedWriter is wrong and also generate warnings

4 participants