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

Don't flush in BufWriter destructor after a panic in write #31068

Merged
merged 1 commit into from
Jan 22, 2016

Conversation

sfackler
Copy link
Member

We don't want to write the same data twice.

Closes #30888

r? @alexcrichton

@@ -300,6 +300,7 @@ impl<R: Seek> Seek for BufReader<R> {
pub struct BufWriter<W: Write> {
inner: Option<W>,
buf: Vec<u8>,
panicked: bool,
Copy link
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 comment explaining what this flag is? e.g. explaining where it's set, what it's used to detect, and what goes wrong if it's not here.

@alexcrichton
Copy link
Member

Looks good to me, r=me with a comment, thanks!

We don't want to write the same data twice.

Closes rust-lang#30888
@sfackler
Copy link
Member Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Jan 21, 2016

📌 Commit 334bee3 has been approved by alexcrichton

bors added a commit that referenced this pull request Jan 22, 2016
We don't want to write the same data twice.

Closes #30888

r? @alexcrichton
@bors
Copy link
Contributor

bors commented Jan 22, 2016

⌛ Testing commit 334bee3 with merge 62c8256...

@bors bors merged commit 334bee3 into rust-lang:master Jan 22, 2016
@sfackler sfackler deleted the bufwriter-panic branch November 26, 2016 05:50
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.

3 participants