summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2017-05-24 23:02:05 -0400
committerAndrew Gallant <jamslam@gmail.com>2017-05-24 23:16:31 -0400
commitb0da83b82511efefbc4458ccd40109f98e3189fb (patch)
tree2c8fd114e1e42619a60f226240b0614a38b969f1 /src/main.rs
parent0f58a988016327016378a21bf4e335a41b51b2e9 (diff)
small performance improvements0.12.1
For the most part, this switches write_record to write_byte_record where possible, and also moves some uses of the `byte_records` iterator to the manual `read_byte_record` method, which permits us to amortize allocation. This also removes the use of normal selection for `xsv search`, which was causing a huge slow down. Also, bump to csv 1.0.0.beta.3.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index ca0f5ce..f0d4d81 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -216,9 +216,12 @@ impl From<docopt::Error> for CliError {
impl From<csv::Error> for CliError {
fn from(err: csv::Error) -> CliError {
- match err {
- csv::Error::Io(v) => From::from(v),
- v => CliError::Csv(v),
+ if !err.is_io_error() {
+ return CliError::Csv(err);
+ }
+ match err.into_kind() {
+ csv::ErrorKind::Io(v) => From::from(v),
+ _ => unreachable!(),
}
}
}