Skip to content

Quotes included despite using QuoteStyle::Never #276

Open
@hniksic

Description

@hniksic

The docs for QuoteStyle::Never say:

This never writes quotes, even if it would produce invalid CSV data.

Based on that, I would expect the following program to output a line with foo followed by an empty line, followed by a line with bar,baz:

fn main() {
    let mut writer = csv::WriterBuilder::new()
        .quote_style(csv::QuoteStyle::Never)
        .from_path("/dev/stdout")
        .unwrap();
    writer.write_record(["foo"]).unwrap();
    writer.write_record([""]).unwrap();
    writer.write_record(["bar,baz"]).unwrap();
}

Expected output:

foo

bar,baz

But actual output is:

foo
""
bar,baz

Is there a way to prevent the writer from generating quotes?

I am using csv 1.1.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions