1 use std::{error::Error, io, process};
2 
main()3 fn main() {
4     if let Err(err) = run() {
5         println!("{}", err);
6         process::exit(1);
7     }
8 }
9 
run() -> Result<(), Box<dyn Error>>10 fn run() -> Result<(), Box<dyn Error>> {
11     let mut rdr = csv::Reader::from_reader(io::stdin());
12     for result in rdr.records() {
13         // This is effectively the same code as our `match` in the
14         // previous example. In other words, `?` is syntactic sugar.
15         let record = result?;
16         println!("{:?}", record);
17     }
18     Ok(())
19 }
20