Skip to content

Only flush underlying writer on explicit flush call, not full buffer - #174

Merged
BurntSushi merged 1 commit into
BurntSushi:masterfrom
owst:flush_buf_not_underlying_writer_on_full_buf
Jan 7, 2020
Merged

BurntSushi merged 1 commit into
BurntSushi:masterfrom
owst:flush_buf_not_underlying_writer_on_full_buf

Conversation

@owst

@owst owst commented Oct 6, 2019

Copy link
Copy Markdown
Contributor

Fixes #173

@owst

owst commented Dec 1, 2019

Copy link
Copy Markdown
Contributor Author

Hi @BurntSushi, any chance you would be able to take a look at this PR? The issue it causes in xsv (BurntSushi/xsv#151) is quite annoying - it'd be great to have it fixed. Thanks!

@owst

owst commented Jan 7, 2020

Copy link
Copy Markdown
Contributor Author

Hi @BurntSushi sorry to pester again, but any chance you can take a look at this PR and then hopefully get BurntSushi/xsv#151 resolved?

@BurntSushi BurntSushi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for digging into this and coming up with a fix. This all looks great to me.

Apologies for the late attention, but I've been inactive for a bit.

Comment thread src/writer.rs
// As the buffer size is 4 we should write each record separately, and
// flush when explicitly called and implictly in into_inner.
assert_eq!(got, ">a,b\n<>c,d\n<!>e,f\n<!");
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Great test, thank you!

@BurntSushi
BurntSushi merged commit e2c2468 into BurntSushi:master Jan 7, 2020
@BurntSushi

Copy link
Copy Markdown
Owner

This PR is in csv 1.1.2 on crates.io.

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.

Do not flush underlying writer when buffer becomes full

2 participants