• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Import the standard library's I/O module so we can read from stdin.
2 use std::io;
3 
4 // The `main` function is where your program starts executing.
main()5 fn main() {
6     // Create a CSV parser that reads data from stdin.
7     let mut rdr = csv::Reader::from_reader(io::stdin());
8     // Loop over each record.
9     for result in rdr.records() {
10         // An error may occur, so abort the program in an unfriendly way.
11         // We will make this more friendly later!
12         let record = result.expect("a CSV record");
13         // Print a debug version of the record.
14         println!("{:?}", record);
15     }
16 }
17