Skip to content

Commit 43c6b6c

Browse files
committed
avro: fix clippy in projection coercion path
1 parent 8805368 commit 43c6b6c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

datafusion/datasource-avro/src/source.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ impl AvroSource {
115115
}
116116

117117
fn coerce_batch_to_schema(
118-
batch: RecordBatch,
118+
batch: &RecordBatch,
119119
target_schema: SchemaRef,
120120
) -> Result<RecordBatch> {
121121
let mut columns = Vec::with_capacity(target_schema.fields().len());
122122
for field in target_schema.fields() {
123123
let array: ArrayRef = match batch.schema().column_with_name(field.name()) {
124124
Some((idx, _)) => {
125-
let source_array = batch.column(idx).clone();
125+
let source_array = Arc::clone(batch.column(idx));
126126
if source_array.data_type() == field.data_type() {
127127
source_array
128128
} else {
@@ -255,7 +255,7 @@ mod private {
255255
.map(move |r| {
256256
r.map_err(Into::into).and_then(|batch| {
257257
coerce_batch_to_schema(
258-
batch,
258+
&batch,
259259
Arc::clone(&projected_file_schema),
260260
)
261261
})
@@ -278,7 +278,7 @@ mod private {
278278
.map(move |r| {
279279
r.map_err(Into::into).and_then(|batch| {
280280
coerce_batch_to_schema(
281-
batch,
281+
&batch,
282282
Arc::clone(&projected_file_schema),
283283
)
284284
})

0 commit comments

Comments
 (0)