From 944ca27608d75b3dbc6b9ccf92e61e2f82564aa3 Mon Sep 17 00:00:00 2001 From: emcake <3726783+emcake@users.noreply.github.com> Date: Tue, 19 Dec 2023 22:20:00 +0000 Subject: [PATCH] more clippy --- crates/deltalake-core/tests/fs_common/mod.rs | 29 ++++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/crates/deltalake-core/tests/fs_common/mod.rs b/crates/deltalake-core/tests/fs_common/mod.rs index c79fc833da..2fbaf7fbc4 100644 --- a/crates/deltalake-core/tests/fs_common/mod.rs +++ b/crates/deltalake-core/tests/fs_common/mod.rs @@ -9,7 +9,7 @@ use deltalake_core::storage::config::configure_store; use deltalake_core::storage::{GetResult, ObjectStoreResult}; use deltalake_core::DeltaTable; use object_store::path::Path as StorePath; -use object_store::ObjectStore; +use object_store::{ObjectStore, PutOptions, PutResult}; use serde_json::Value; use std::collections::HashMap; use std::fs; @@ -160,10 +160,19 @@ impl SlowStore { #[async_trait::async_trait] impl ObjectStore for SlowStore { /// Save the provided bytes to the specified location. - async fn put(&self, location: &StorePath, bytes: bytes::Bytes) -> ObjectStoreResult<()> { + async fn put(&self, location: &StorePath, bytes: bytes::Bytes) -> ObjectStoreResult { self.inner.put(location, bytes).await } + async fn put_opts( + &self, + location: &StorePath, + bytes: bytes::Bytes, + options: PutOptions, + ) -> ObjectStoreResult { + self.inner.put_opts(location, bytes, options).await + } + /// Return the bytes that are stored at the specified location. async fn get(&self, location: &StorePath) -> ObjectStoreResult { tokio::time::sleep(tokio::time::Duration::from_secs_f64(0.01)).await; @@ -205,27 +214,23 @@ impl ObjectStore for SlowStore { /// /// Prefixes are evaluated on a path segment basis, i.e. `foo/bar/` is a prefix of `foo/bar/x` but not of /// `foo/bar_baz/x`. - async fn list( + fn list( &self, prefix: Option<&StorePath>, - ) -> ObjectStoreResult< - futures::stream::BoxStream<'_, ObjectStoreResult>, - > { - self.inner.list(prefix).await + ) -> futures::stream::BoxStream<'_, ObjectStoreResult> { + self.inner.list(prefix) } /// List all the objects with the given prefix and a location greater than `offset` /// /// Some stores, such as S3 and GCS, may be able to push `offset` down to reduce /// the number of network requests required - async fn list_with_offset( + fn list_with_offset( &self, prefix: Option<&StorePath>, offset: &StorePath, - ) -> ObjectStoreResult< - futures::stream::BoxStream<'_, ObjectStoreResult>, - > { - self.inner.list_with_offset(prefix, offset).await + ) -> futures::stream::BoxStream<'_, ObjectStoreResult> { + self.inner.list_with_offset(prefix, offset) } /// List objects with the given prefix and an implementation specific