1 use std::{error::Error, io, process}; 2 example() -> Result<(), Box<dyn Error>>3fn example() -> Result<(), Box<dyn Error>> { 4 let mut rdr = 5 csv::ReaderBuilder::new().has_headers(false).from_reader(io::stdin()); 6 for result in rdr.records() { 7 let record = result?; 8 println!("{:?}", record); 9 } 10 Ok(()) 11 } 12 main()13fn main() { 14 if let Err(err) = example() { 15 println!("error running example: {}", err); 16 process::exit(1); 17 } 18 } 19