topic: file i/o
reading and writing files, parsing structured data.
concepts to demonstrate
std::fs::read_to_string, File::open
BufReader for line-by-line reading
- csv crate for typed CSV deserialization into structs
- serde_json for reading/writing JSON
- proper error propagation with
? and anyhow
patriots theme
read datasets/roster_2004.csv into a Vec<Player>.
write a filtered stats summary to output/rushing_leaders.json.
files
src/file_io/read_roster.rs
src/file_io/write_summary.rs
reference
python mirror: basic_example_working_with_files_players.py