diff --git a/arrow/src/csv/reader.rs b/arrow/src/csv/reader.rs index d8841964b586..ae9f3dd229c5 100644 --- a/arrow/src/csv/reader.rs +++ b/arrow/src/csv/reader.rs @@ -120,7 +120,7 @@ pub struct ReaderOptions { /// Return inferred schema and number of records used for inference. This function does not change /// reader cursor offset. pub fn infer_file_schema( - reader: &mut R, + reader: R, delimiter: u8, max_read_records: Option, has_header: bool, @@ -136,12 +136,13 @@ pub fn infer_file_schema( } fn infer_file_schema_with_csv_options( - reader: &mut R, - roptoins: ReaderOptions, + mut reader: R, + roptions: ReaderOptions, ) -> Result<(Schema, usize)> { let saved_offset = reader.seek(SeekFrom::Current(0))?; - let (schema, records_count) = infer_reader_schema_with_csv_options(reader, roptoins)?; + let (schema, records_count) = + infer_reader_schema_with_csv_options(&mut reader, roptions)?; // return the reader seek back to the start reader.seek(SeekFrom::Start(saved_offset))?; @@ -155,7 +156,7 @@ fn infer_file_schema_with_csv_options( /// /// Return infered schema and number of records used for inference. pub fn infer_reader_schema( - reader: &mut R, + reader: R, delimiter: u8, max_read_records: Option, has_header: bool, @@ -170,7 +171,7 @@ pub fn infer_reader_schema( } fn infer_reader_schema_with_csv_options( - reader: &mut R, + reader: R, roptions: ReaderOptions, ) -> Result<(Schema, usize)> { let mut csv_reader = Reader::build_csv_reader(