BurntSushi / BurntSushi/rust-csv

Quotes included despite using QuoteStyle::Never

Open
#276 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

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`:

```rust
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.