mirror of
https://github.com/rust-lang-nursery/rust-cookbook
synced 2024-11-21 19:13:07 +00:00
Minor cleanup of csv examples
This commit is contained in:
parent
0442eba2d7
commit
4858d0ac3e
1 changed files with 6 additions and 6 deletions
|
@ -476,10 +476,10 @@ struct Record {
|
|||
|
||||
fn run() -> Result<()> {
|
||||
let data = "name,place,id
|
||||
mark,sydney,46.5
|
||||
ashley,zurich,92
|
||||
akshat,delhi,37
|
||||
alisha,colombo,xyz";
|
||||
mark,sydney,46.5
|
||||
ashley,zurich,92
|
||||
akshat,delhi,37
|
||||
alisha,colombo,xyz";
|
||||
|
||||
let mut rdr = csv::Reader::from_reader(data.as_bytes());
|
||||
for result in rdr.deserialize() {
|
||||
|
@ -529,8 +529,8 @@ use csv::ReaderBuilder;
|
|||
|
||||
fn run() -> Result<()> {
|
||||
let data = "name-place-id
|
||||
Mark-Melbourne-46
|
||||
Ashley-Zurich-92";
|
||||
Mark-Melbourne-46
|
||||
Ashley-Zurich-92";
|
||||
|
||||
let mut reader = ReaderBuilder::new().delimiter(b'-').from_reader(data.as_bytes());
|
||||
for result in reader.records() {
|
||||
|
|
Loading…
Reference in a new issue