Skip to content

Commit 92b7cb9

Browse files
committed
Fix lints
1 parent 819913a commit 92b7cb9

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

arrow/src/util/pretty.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn create_table(results: &[RecordBatch]) -> Result<Table> {
7474
let mut cells = Vec::new();
7575
for col in 0..batch.num_columns() {
7676
let column = batch.column(col);
77-
cells.push(Cell::new(&array_value_to_string(&column, row)?));
77+
cells.push(Cell::new(&array_value_to_string(column, row)?));
7878
}
7979
table.add_row(cells);
8080
}
@@ -96,7 +96,7 @@ fn create_column(field: &str, columns: &[ArrayRef]) -> Result<Table> {
9696

9797
for col in columns {
9898
for row in 0..col.len() {
99-
let cells = vec![Cell::new(&array_value_to_string(&col, row)?)];
99+
let cells = vec![Cell::new(&array_value_to_string(col, row)?)];
100100
table.add_row(cells);
101101
}
102102
}
@@ -320,7 +320,7 @@ mod tests {
320320
let mut builder = FixedSizeBinaryBuilder::new(3, 3);
321321

322322
builder.append_value(&[1, 2, 3]).unwrap();
323-
builder.append_null();
323+
builder.append_null().unwrap();
324324
builder.append_value(&[7, 8, 9]).unwrap();
325325

326326
let array = Arc::new(builder.finish());
@@ -677,7 +677,7 @@ mod tests {
677677
)?;
678678

679679
let mut buf = String::new();
680-
write!(&mut buf, "{}", pretty_format_batches(&[batch])?.to_string()).unwrap();
680+
write!(&mut buf, "{}", pretty_format_batches(&[batch])?).unwrap();
681681

682682
let s = vec![
683683
"+---+-----+",
@@ -689,7 +689,7 @@ mod tests {
689689
"| d | 100 |",
690690
"+---+-----+",
691691
];
692-
let expected = String::from(s.join("\n"));
692+
let expected = s.join("\n");
693693
assert_eq!(expected, buf);
694694

695695
Ok(())

parquet/src/arrow/async_reader.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl<T: AsyncRead + AsyncSeek + Unpin> ParquetRecordBatchStreamBuilder<T> {
112112
/// Only read data from the provided column indexes
113113
pub fn with_projection(self, projection: Vec<usize>) -> Self {
114114
Self {
115-
projection: Some(projection.into()),
115+
projection: Some(projection),
116116
..self
117117
}
118118
}
@@ -339,7 +339,7 @@ async fn read_footer<T: AsyncRead + AsyncSeek + Unpin>(
339339
let mut buf = [0_u8; 8];
340340
input.read_exact(&mut buf).await?;
341341

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

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

458-
let stream = builder
459-
.build()
460-
.unwrap();
458+
let stream = builder.build().unwrap();
461459

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

0 commit comments

Comments
 (0)