How to Parse CSV in Rust

Parse CSV files in Rust using the `csv` crate by creating a Reader and iterating over records.

Use the csv crate to parse CSV files efficiently and safely in Rust. Add the crate to your project, read the file into a Reader, and iterate over records while handling errors.

[dependencies]
csv = "1.3"
use csv::ReaderBuilder;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let mut reader = ReaderBuilder::new().from_path("data.csv")?;
    for result in reader.records() {
        let record = result?;
        println!("{:?}", record);
    }
    Ok(())
}