blob: 536dab3e3bd3b81ba37e9ad4f684d6c161850b09 [file] [log] [blame]
Jakub Koturc72d7202020-12-21 17:28:15 +01001// Import the standard library's I/O module so we can read from stdin.
2use std::io;
3
4// The `main` function is where your program starts executing.
5fn 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}