This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 1a64677b7 csv::infer_file_schema remove redundant ref (#1776)
1a64677b7 is described below
commit 1a64677b7e368b1fed586d4f2d590eaefc5a7e1e
Author: Raphael Taylor-Davies <[email protected]>
AuthorDate: Thu Jun 2 19:24:02 2022 +0100
csv::infer_file_schema remove redundant ref (#1776)
* csv::infer_file_schema remove redundant ref
* Fix compile
---
arrow/src/csv/reader.rs | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/arrow/src/csv/reader.rs b/arrow/src/csv/reader.rs
index d8841964b..ae9f3dd22 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<R: Read + Seek>(
- reader: &mut R,
+ reader: R,
delimiter: u8,
max_read_records: Option<usize>,
has_header: bool,
@@ -136,12 +136,13 @@ pub fn infer_file_schema<R: Read + Seek>(
}
fn infer_file_schema_with_csv_options<R: Read + Seek>(
- 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<R: Read + Seek>(
///
/// Return infered schema and number of records used for inference.
pub fn infer_reader_schema<R: Read>(
- reader: &mut R,
+ reader: R,
delimiter: u8,
max_read_records: Option<usize>,
has_header: bool,
@@ -170,7 +171,7 @@ pub fn infer_reader_schema<R: Read>(
}
fn infer_reader_schema_with_csv_options<R: Read>(
- reader: &mut R,
+ reader: R,
roptions: ReaderOptions,
) -> Result<(Schema, usize)> {
let mut csv_reader = Reader::build_csv_reader(