Initial import of csv-1.1.5.
Bug: 155309706
Change-Id: Id08b46b0989d3b869c4a014d10ea98193b7c3b32
diff --git a/examples/tutorial-setup-01.rs b/examples/tutorial-setup-01.rs
new file mode 100644
index 0000000..536dab3
--- /dev/null
+++ b/examples/tutorial-setup-01.rs
@@ -0,0 +1,16 @@
+// Import the standard library's I/O module so we can read from stdin.
+use std::io;
+
+// The `main` function is where your program starts executing.
+fn main() {
+ // Create a CSV parser that reads data from stdin.
+ let mut rdr = csv::Reader::from_reader(io::stdin());
+ // Loop over each record.
+ for result in rdr.records() {
+ // An error may occur, so abort the program in an unfriendly way.
+ // We will make this more friendly later!
+ let record = result.expect("a CSV record");
+ // Print a debug version of the record.
+ println!("{:?}", record);
+ }
+}