Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Jan 29, 2022
1 parent 819913a commit 78f71ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions arrow/src/util/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn create_table(results: &[RecordBatch]) -> Result<Table> {
let mut cells = Vec::new();
for col in 0..batch.num_columns() {
let column = batch.column(col);
cells.push(Cell::new(&array_value_to_string(&column, row)?));
cells.push(Cell::new(&array_value_to_string(column, row)?));
}
table.add_row(cells);
}
Expand All @@ -96,7 +96,7 @@ fn create_column(field: &str, columns: &[ArrayRef]) -> Result<Table> {

for col in columns {
for row in 0..col.len() {
let cells = vec![Cell::new(&array_value_to_string(&col, row)?)];
let cells = vec![Cell::new(&array_value_to_string(col, row)?)];
table.add_row(cells);
}
}
Expand Down
8 changes: 3 additions & 5 deletions parquet/src/arrow/async_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl<T: AsyncRead + AsyncSeek + Unpin> ParquetRecordBatchStreamBuilder<T> {
/// Only read data from the provided column indexes
pub fn with_projection(self, projection: Vec<usize>) -> Self {
Self {
projection: Some(projection.into()),
projection: Some(projection),
..self
}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ async fn read_footer<T: AsyncRead + AsyncSeek + Unpin>(
let mut buf = [0_u8; 8];
input.read_exact(&mut buf).await?;

if &buf[4..] != PARQUET_MAGIC {
if buf[4..] != PARQUET_MAGIC {
return Err(general_err!("Invalid Parquet file. Corrupt footer"));
}

Expand Down Expand Up @@ -455,9 +455,7 @@ mod tests {
.with_projection(vec![1, 2, 6])
.with_batch_size(3);

let stream = builder
.build()
.unwrap();
let stream = builder.build().unwrap();

let results = stream.try_collect::<Vec<_>>().await.unwrap();
assert_eq!(results.len(), 3);
Expand Down

0 comments on commit 78f71ab

Please sign in to comment.