csv 0.12.19

CSV parsing with automatic type based decoding and encoding.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![feature(old_path)]

extern crate csv;

use std::old_path::Path;

fn main() {
    let fp = &Path::new("./data/simple.csv");
    let mut rdr = csv::Reader::from_file(fp);

    for record in rdr.decode() {
        let (s1, s2, dist): (String, String, usize) = record.unwrap();
        println!("({}, {}): {}", s1, s2, dist);
    }
}