1 use std::error::Error; 2 use std::io; 3 use std::process; 4 run() -> Result<(), Box<dyn Error>>5fn run() -> Result<(), Box<dyn Error>> { 6 let mut rdr = csv::ReaderBuilder::new() 7 .has_headers(false) 8 .delimiter(b';') 9 .double_quote(false) 10 .escape(Some(b'\\')) 11 .flexible(true) 12 .comment(Some(b'#')) 13 .from_reader(io::stdin()); 14 for result in rdr.records() { 15 let record = result?; 16 println!("{:?}", record); 17 } 18 Ok(()) 19 } 20 main()21fn main() { 22 if let Err(err) = run() { 23 println!("{}", err); 24 process::exit(1); 25 } 26 } 27