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