From e6f3e7908f5771796d77e9ac98dd46082904afd5 Mon Sep 17 00:00:00 2001 From: Parker Timmerman Date: Thu, 30 Jan 2025 14:28:01 -0500 Subject: [PATCH] fix clippy 2 --- src/storage-operators/src/oneshot_source/http_source.rs | 7 ++----- src/storage-operators/src/oneshot_source/parquet.rs | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/storage-operators/src/oneshot_source/http_source.rs b/src/storage-operators/src/oneshot_source/http_source.rs index d15ef0e55df5b..c9bf996082cbc 100644 --- a/src/storage-operators/src/oneshot_source/http_source.rs +++ b/src/storage-operators/src/oneshot_source/http_source.rs @@ -135,11 +135,8 @@ impl OneshotSource for HttpOneshotSource { // Get the size of the object from the Conent-Length header. let size = get_header(&reqwest::header::CONTENT_LENGTH) - .ok_or_else(|| StorageErrorXKind::MissingSize) - .and_then(|s| { - s.parse::() - .map_err(|e| StorageErrorXKind::generic(e)) - }) + .ok_or(StorageErrorXKind::MissingSize) + .and_then(|s| s.parse::().map_err(StorageErrorXKind::generic)) .context("content-length header")?; // TODO(cf1): We should probably check the content-type as well. At least for advisory purposes. diff --git a/src/storage-operators/src/oneshot_source/parquet.rs b/src/storage-operators/src/oneshot_source/parquet.rs index 06f581bf064c1..b4e52315eec2f 100644 --- a/src/storage-operators/src/oneshot_source/parquet.rs +++ b/src/storage-operators/src/oneshot_source/parquet.rs @@ -212,7 +212,7 @@ impl AsyncFileReader for ParquetReaderAdapter { let mut reader = ParquetMetaDataReader::new(); let object_size = self.object.size(); reader.try_load(self, object_size).await?; - reader.finish().map(|metadata| Arc::new(metadata)) + reader.finish().map(Arc::new) }) } } @@ -266,7 +266,7 @@ impl<'de> Deserialize<'de> for ParquetRowGroup { let struct_array = array_ref .as_any() .downcast_ref::() - .ok_or_else(|| serde_err())?; + .ok_or_else(serde_err)?; Ok(struct_array.clone()) }