Add the csv crate to your Cargo.toml and use Reader::from_path to parse files into records or structs.
[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(())
}