1 use std::io;
2 use std::process;
3 
main()4 fn main() {
5     let mut rdr = csv::Reader::from_reader(io::stdin());
6     for result in rdr.records() {
7         // Examine our Result.
8         // If there was no problem, print the record.
9         // Otherwise, print the error message and quit the program.
10         match result {
11             Ok(record) => println!("{:?}", record),
12             Err(err) => {
13                 println!("error reading CSV from <stdin>: {}", err);
14                 process::exit(1);
15             }
16         }
17     }
18 }
19