Skip to content

fix: respect QuoteStyle::Never for empty fields#429

Open
SAY-5 wants to merge 1 commit into
BurntSushi:masterfrom
SAY-5:fix-never-quote-empty-field
Open

fix: respect QuoteStyle::Never for empty fields#429
SAY-5 wants to merge 1 commit into
BurntSushi:masterfrom
SAY-5:fix-never-quote-empty-field

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 25, 2026

Copy link
Copy Markdown

When writing an empty field with QuoteStyle::Never, the writer still produced "" instead of leaving it bare. The terminator and finish methods in csv-core unconditionally wrote a pair of quote characters for empty fields without checking the configured quoting style.

Added a guard so the empty-field quoting is skipped when the style is Never, and derived PartialEq on QuoteStyle to enable the comparison. Regression tests added in both csv-core and csv.

Fixes #276.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
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.

Quotes included despite using QuoteStyle::Never

1 participant