File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -326,15 +326,14 @@ impl ReaderBuilder {
326326 writer_schema : & Schema ,
327327 reader_schema : Option < & AvroSchema > ,
328328 ) -> Result < RecordDecoder , ArrowError > {
329- let root = match reader_schema {
330- Some ( reader_schema) => {
331- AvroFieldBuilder :: new ( writer_schema) . with_reader_schema ( reader_schema. clone ( ) )
332- }
333- _ => AvroFieldBuilder :: new ( writer_schema) ,
329+ let mut builder = AvroFieldBuilder :: new ( writer_schema) ;
330+ if let Some ( reader_schema) = reader_schema {
331+ builder = builder. with_reader_schema ( reader_schema. clone ( ) ) ;
334332 }
335- . with_utf8view ( self . utf8_view )
336- . with_strict_mode ( self . strict_mode )
337- . build ( ) ?;
333+ let root = builder
334+ . with_utf8view ( self . utf8_view )
335+ . with_strict_mode ( self . strict_mode )
336+ . build ( ) ?;
338337 RecordDecoder :: try_new_with_options ( root. data_type ( ) , self . utf8_view )
339338 }
340339
You can’t perform that action at this time.
0 commit comments