From 578115bbdefae45c8378ee70cf1aef9dff858f46 Mon Sep 17 00:00:00 2001 From: Huo Linhe Date: Fri, 26 Jan 2018 15:37:23 +0800 Subject: [PATCH] fix: print out error in case of range size is 0 --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index c8b0c69..9df90da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -119,6 +119,10 @@ fn main() { let mut wtr = csv::WriterBuilder::new().delimiter(*delimiter).from_path(path).expect("open csv"); let size = range.get_size(); println!("** sheet range size is {:?}", size); + if size.0 == 0 || size.1 == 0 { + eprintln!("worsheet range sizes should not be 0, continue"); + continue; + } println!("** start writing", ); let mut pb = ProgressBar::new(100); let rows = range.rows();