Commit activity
Last 12 weeks · 0 commits
Community health
3 of 6 standards met
Recent PRs & issues
With , every field goes through and then . Text fields fail both, so they pay for two parses each. Changes: fields that are only digits (with an optional sign) return without parsing fields whose first byte can't start a number return right away the parse is gone, since accepts every string does Writer benchmarks with (time per iteration): For reference, is ~0.8 ms and ~2.3 ms on the same data. I checked the new function against the old one on about 1M generated inputs (signs, exponents, inf/nan spellings, junk) and got the same result for all of them. Also added a small unit test.
With the default , one record with the wrong field count breaks every write after it: The check runs before the terminator is written and is never reset, so the bad record's fields stay in the buffer, the next record is appended to the same line and the count only grows from there. Rolling the record back isn't possible since may already have flushed part of it, so this writes the terminator and resets the counter first, then returns the error. The bad record still ends up in the output (as before), but it is on its own line and later records are fine. Added a test covering both and .
A or unit struct field in a struct read with headers doesn't consume its column, so every field after it is off by one: In map mode the key comes from the headers, but / never read the value from the record. Same thing happens with . The fix reads (and drops) the field when headers are in use. It doesn't fail if there's no field left, so deserializing an empty record as still works. Without headers nothing changes, since a field there currently takes no column and people may rely on that.
Repository: BurntSushi/rust-csv. Description: A CSV parser for Rust, with Serde support. Stars: 1967, Forks: 265. Primary language: Rust. Languages: Rust (99.5%), Shell (0.3%), Python (0.2%). License: Unlicense. Topics: csv, library, rust, rust-library. Open PRs: 47, open issues: 65. Last activity: 3mo ago. Community health: 42%. Top contributors: BurntSushi, paolobarbolini, brandonw, EvinRobertson, fhartwig, huonw, igor-raits, jturner314, thaliaarchi, timhabermaas and others.