From 97994df25f4d560caddefc13decd3e163ff24687 Mon Sep 17 00:00:00 2001 From: meteorgan Date: Mon, 9 Sep 2024 22:34:34 +0800 Subject: [PATCH] fix cargo clippy --- core/src/raw/oio/list/page_list.rs | 2 +- core/src/raw/ops.rs | 2 +- core/src/services/s3/core.rs | 5 +++-- core/src/services/s3/lister.rs | 2 +- core/src/types/operator/operator_futures.rs | 4 ++-- core/tests/behavior/async_list.rs | 1 - 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/raw/oio/list/page_list.rs b/core/src/raw/oio/list/page_list.rs index ae4f1020532..bc4305224ae 100644 --- a/core/src/raw/oio/list/page_list.rs +++ b/core/src/raw/oio/list/page_list.rs @@ -46,7 +46,7 @@ pub trait PageList: Send + Sync + Unpin + 'static { /// - Set `done` to `true` if all page have been fetched. /// - Update `token` if there is more page to fetch. `token` is not exposed to users, it's internal used only. /// - Update `key_marker` and `version_id_marker` if object versioning is enabled and there are more page to fetch. -/// similar to `token`, they should only be internal used +/// similar to `token`, they should only be internal used /// - Push back into the entries for each entry fetched from underlying storage. /// /// NOTE: `entries` is a `VecDeque` to avoid unnecessary memory allocation. Only `push_back` is allowed. diff --git a/core/src/raw/ops.rs b/core/src/raw/ops.rs index a69c72e8917..a9b7cd37129 100644 --- a/core/src/raw/ops.rs +++ b/core/src/raw/ops.rs @@ -103,7 +103,7 @@ pub struct OpList { /// /// - If `false`, list operation will not return with object versions /// - If `true`, list operation will return with object versions if object versioning is supported - /// by the underlying service + /// by the underlying service /// /// Default to `false` version: bool, diff --git a/core/src/services/s3/core.rs b/core/src/services/s3/core.rs index 3db421e230f..adbff112d0a 100644 --- a/core/src/services/s3/core.rs +++ b/core/src/services/s3/core.rs @@ -813,13 +813,14 @@ impl S3Core { write!(url, "&max-keys={}", limit).expect("write into string must succeed"); } if !key_marker.is_empty() { - write!(url, "&key-marker={}", key_marker).expect("write into string must succeed"); + write!(url, "&key-marker={}", percent_encode_path(key_marker)) + .expect("write into string must succeed"); } if !version_id_marker.is_empty() { write!( url, "&version-id-marker={}", - percent_encode_path(&version_id_marker) + percent_encode_path(version_id_marker) ) .expect("write into string must succeed"); } diff --git a/core/src/services/s3/lister.rs b/core/src/services/s3/lister.rs index 976bf41b459..4db78790ff7 100644 --- a/core/src/services/s3/lister.rs +++ b/core/src/services/s3/lister.rs @@ -209,7 +209,7 @@ impl oio::PageList for S3ObjectVersionsLister { )?); if let Some(etag) = version_object.etag { meta.set_etag(&etag); - meta.set_content_md5(&etag.trim_matches('"')); + meta.set_content_md5(etag.trim_matches('"')); } let entry = oio::Entry::new(&path, meta); diff --git a/core/src/types/operator/operator_futures.rs b/core/src/types/operator/operator_futures.rs index eaee5aa4881..777c817e0f8 100644 --- a/core/src/types/operator/operator_futures.rs +++ b/core/src/types/operator/operator_futures.rs @@ -480,7 +480,7 @@ impl>>> FutureList { /// /// - If `false`, list operation will not return with object versions /// - If `true`, list operation will return with object versions if object versioning is supported - /// by the underlying service + /// by the underlying service /// /// Default to `false` pub fn version(self, v: bool) -> Self { @@ -543,7 +543,7 @@ impl>> FutureLister { /// /// - If `false`, list operation will not return with object versions /// - If `true`, list operation will return with object versions if object versioning is supported - /// by the underlying service + /// by the underlying service /// /// Default to `false` pub fn version(self, v: bool) -> Self { diff --git a/core/tests/behavior/async_list.rs b/core/tests/behavior/async_list.rs index 24cac3c523c..7c17e9e8fe3 100644 --- a/core/tests/behavior/async_list.rs +++ b/core/tests/behavior/async_list.rs @@ -693,7 +693,6 @@ pub async fn test_list_files_with_version(op: Operator) -> Result<()> { op.write(file_path.as_str(), "2").await?; let mut ds = op.list_with(parent.as_str()).version(true).await?; - println!("{:?}", ds); ds.retain(|de| de.path() != parent.as_str()); assert_eq!(ds.len(), 2);