@@ -42,6 +42,7 @@ pub struct LineData<'a> {
4242 pub selections : Vec < & ' a str > ,
4343 pub num_infos : Vec < NumInfo > ,
4444 pub parsed_floats : Vec < GeneralF64ParseResult > ,
45+ pub line_num_floats : Vec < Option < f64 > > ,
4546}
4647
4748impl Chunk {
@@ -52,6 +53,7 @@ impl Chunk {
5253 contents. line_data . selections . clear ( ) ;
5354 contents. line_data . num_infos . clear ( ) ;
5455 contents. line_data . parsed_floats . clear ( ) ;
56+ contents. line_data . line_num_floats . clear ( ) ;
5557 let lines = unsafe {
5658 // SAFETY: It is safe to (temporarily) transmute to a vector of lines with a longer lifetime,
5759 // because the vector is empty.
@@ -73,13 +75,15 @@ impl Chunk {
7375 selections,
7476 std:: mem:: take ( & mut contents. line_data . num_infos ) ,
7577 std:: mem:: take ( & mut contents. line_data . parsed_floats ) ,
78+ std:: mem:: take ( & mut contents. line_data . line_num_floats ) ,
7679 )
7780 } ) ;
7881 RecycledChunk {
7982 lines : recycled_contents. 0 ,
8083 selections : recycled_contents. 1 ,
8184 num_infos : recycled_contents. 2 ,
8285 parsed_floats : recycled_contents. 3 ,
86+ line_num_floats : recycled_contents. 4 ,
8387 buffer : self . into_owner ( ) ,
8488 }
8589 }
@@ -97,6 +101,7 @@ pub struct RecycledChunk {
97101 selections : Vec < & ' static str > ,
98102 num_infos : Vec < NumInfo > ,
99103 parsed_floats : Vec < GeneralF64ParseResult > ,
104+ line_num_floats : Vec < Option < f64 > > ,
100105 buffer : Vec < u8 > ,
101106}
102107
@@ -107,6 +112,7 @@ impl RecycledChunk {
107112 selections : Vec :: new ( ) ,
108113 num_infos : Vec :: new ( ) ,
109114 parsed_floats : Vec :: new ( ) ,
115+ line_num_floats : Vec :: new ( ) ,
110116 buffer : vec ! [ 0 ; capacity] ,
111117 }
112118 }
@@ -149,6 +155,7 @@ pub fn read<T: Read>(
149155 selections,
150156 num_infos,
151157 parsed_floats,
158+ line_num_floats,
152159 mut buffer,
153160 } = recycled_chunk;
154161 if buffer. len ( ) < carry_over. len ( ) {
@@ -184,6 +191,7 @@ pub fn read<T: Read>(
184191 selections,
185192 num_infos,
186193 parsed_floats,
194+ line_num_floats,
187195 } ;
188196 parse_lines ( read, & mut lines, & mut line_data, separator, settings) ;
189197 Ok ( ChunkContents { lines, line_data } )
@@ -207,6 +215,7 @@ fn parse_lines<'a>(
207215 assert ! ( line_data. selections. is_empty( ) ) ;
208216 assert ! ( line_data. num_infos. is_empty( ) ) ;
209217 assert ! ( line_data. parsed_floats. is_empty( ) ) ;
218+ assert ! ( line_data. line_num_floats. is_empty( ) ) ;
210219 let mut token_buffer = vec ! [ ] ;
211220 lines. extend (
212221 read. split ( separator as char )
0 commit comments