New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read csv records with different delimeter #235
Conversation
ad39750
to
5815f20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alisha17 Good work! Just few minor details below:
- please update the master TOC in
intro.md
- update the description to
fixes #229
so the issue will autoclose on PR
src/encoding.md
Outdated
use csv::ReaderBuilder; | ||
use std::process; | ||
|
||
fn run() -> Result<(), Box<Error>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not use Box. We prefer error_chain for the sake of conformity
src/encoding.md
Outdated
Ok(()) | ||
} | ||
|
||
fn main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PLease use error_chain's quick_main
src/encoding.md
Outdated
use std::process; | ||
|
||
fn run() -> Result<(), Box<Error>> { | ||
let data = "\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the extra linebreak needed here?
src/encoding.md
Outdated
Mark-Melbourne-46 | ||
Ashley-Zurich-92"; | ||
|
||
let mut reader = ReaderBuilder::new().delimiter(b'-').from_reader(data.as_bytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please mention and link the delimiter
method
src/encoding.md
Outdated
|
||
let mut reader = ReaderBuilder::new().delimiter(b'-').from_reader(data.as_bytes()); | ||
for result in reader.records() { | ||
let record = result?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this extra line? why not use ?
inside the println!
?
Looks good but needs a rebase to deal with the merge conflict. |
I rebased and merged manually. thanks @alisha17 |
fixes #229