alamb commented on a change in pull request #1112:
URL: https://github.com/apache/arrow-rs/pull/1112#discussion_r777231360



##########
File path: arrow/src/csv/reader.rs
##########
@@ -161,38 +160,31 @@ pub fn infer_reader_schema<R: Read>(
     max_read_records: Option<usize>,
     has_header: bool,
 ) -> Result<(Schema, usize)> {
-    infer_reader_schema_with_csv_options(
-        reader,
-        delimiter,
+    let roptions = ReaderOptions {
+        delimiter: Some(delimiter),
         max_read_records,
         has_header,
-        None,
-        None,
-        None,
-    )
+        ..Default::default()
+    };
+    infer_reader_schema_with_csv_options(reader, roptions)
 }
 
 fn infer_reader_schema_with_csv_options<R: Read>(
     reader: &mut R,
-    delimiter: u8,
-    max_read_records: Option<usize>,
-    has_header: bool,
-    escape: Option<u8>,
-    quote: Option<u8>,
-    terminator: Option<u8>,
+    roptions: ReaderOptions,

Review comment:
       👍  this is much nicer




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to