From a7b17d76b3d880c05721c488803ecff3e01c4a11 Mon Sep 17 00:00:00 2001 From: "Jorge C. Leitao" Date: Mon, 20 Dec 2021 07:18:13 +0000 Subject: [PATCH] Clippy --- src/io/avro/write/block.rs | 3 +-- src/io/avro/write/schema.rs | 8 ++------ tests/it/io/avro/read.rs | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/io/avro/write/block.rs b/src/io/avro/write/block.rs index 9251ca24448..562019f6c56 100644 --- a/src/io/avro/write/block.rs +++ b/src/io/avro/write/block.rs @@ -61,10 +61,9 @@ pub fn compress( compressed_block: &mut CompressedBlock, compression: Compression, ) -> Result<()> { + compressed_block.number_of_rows = block.number_of_rows; match compression { Compression::Deflate => todo!(), Compression::Snappy => todo!(), } - compressed_block.number_of_rows = block.number_of_rows; - Ok(()) } diff --git a/src/io/avro/write/schema.rs b/src/io/avro/write/schema.rs index fdee06a1ede..b8cb5917a10 100644 --- a/src/io/avro/write/schema.rs +++ b/src/io/avro/write/schema.rs @@ -5,13 +5,9 @@ use avro_schema::{ use crate::datatypes::*; use crate::error::{ArrowError, Result}; -/// Converts a [`Schema`] to an avro [`AvroSchema::Record`] with it. +/// Converts a [`Schema`] to a vector of [`AvroField`] with it. pub fn to_avro_schema(schema: &Schema) -> Result> { - schema - .fields - .iter() - .map(|field| field_to_field(field)) - .collect() + schema.fields.iter().map(field_to_field).collect() } fn field_to_field(field: &Field) -> Result { diff --git a/tests/it/io/avro/read.rs b/tests/it/io/avro/read.rs index ba58a6901fe..d55e10332d3 100644 --- a/tests/it/io/avro/read.rs +++ b/tests/it/io/avro/read.rs @@ -98,7 +98,7 @@ pub(super) fn data() -> RecordBatch { } pub(super) fn write_avro(codec: Codec) -> std::result::Result, avro_rs::Error> { - let (avro, schema) = schema(); + let (avro, _) = schema(); // a writer needs a schema and something to write to let mut writer = Writer::with_codec(&avro, Vec::new(), codec);