BurntSushi / BurntSushi/rust-csv

Documentation: Add `StringRecord` indexing example to readme/cookbook

Open
#241 1 comment 0 reactions 0 assignees View on GitHub
doc
Dominant language
Rust
Stars
2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

This is just a documentation suggestion so I'm not following the usual issue format if that's okay.

As a new user of this crate as of today, I noticed that reading through the main examples in the [index](https://docs.rs/csv/1.1.6/csv/index.html#example) and also the [cookbook](https://docs.rs/csv/1.1.6/csv/cookbook/index.html) only interact with the records by using `dbg!`. This has the downside in that it doesn't show how to actually *use* a record in a real-life situation, which I believe is indexing it using `.get()` or `[]` to get at each of the "cells" in the CSV. I find the Serde example is quite clear because it's evident that you end up with an instance of `Record`, which has clearly defined types, it's only the non-Serde example where I wasn't sure what I was working with.

So my suggestion is to show this normal indexing behaviour in the main examples, and also link to the `StringRecord` examples for more detail.

I'm happy to write up a PR for this if you agree..

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.