File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1004,6 +1004,12 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
10041004 . map ( |chunk| {
10051005 // amortize allocations
10061006 let mut record = csv:: StringRecord :: with_capacity ( 512 , col_count) ;
1007+ let mut trimmed_record = if trim {
1008+ csv:: StringRecord :: with_capacity ( 512 , col_count)
1009+ } else {
1010+ csv:: StringRecord :: new ( )
1011+ } ;
1012+
10071013 let mut work_date;
10081014 let mut error_buffer = String :: new ( ) ;
10091015 let mut formatted_date = String :: new ( ) ;
@@ -1111,7 +1117,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
11111117 }
11121118
11131119 if trim {
1114- let mut trimmed_record = csv:: StringRecord :: with_capacity ( 512 , col_count) ;
11151120 // record.trim() is faster than trimming each field piecemeal
11161121 record. trim ( ) ;
11171122 record. iter ( ) . for_each ( |field| {
You can’t perform that action at this time.
0 commit comments