You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2024/12/03 05:09:13 UTC
(opendal) branch main updated: chore: fix cargo clippy (#5384)
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new d9807d183 chore: fix cargo clippy (#5384)
d9807d183 is described below
commit d9807d1833b95456b3fcf88b8a555b98fa3afd1f
Author: meteorgan <me...@gmail.com>
AuthorDate: Tue Dec 3 13:09:08 2024 +0800
chore: fix cargo clippy (#5384)
---
core/src/layers/logging.rs | 2 +-
core/src/layers/metrics.rs | 2 +-
core/src/raw/oio/write/append_write.rs | 1 -
core/src/raw/oio/write/multipart_write.rs | 1 -
core/src/raw/serde_util.rs | 2 +-
core/src/services/hdfs_native/backend.rs | 1 -
core/src/services/pcloud/lister.rs | 4 ++--
core/src/services/swift/error.rs | 4 ++--
8 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/core/src/layers/logging.rs b/core/src/layers/logging.rs
index ec929e50d..30ec40ebb 100644
--- a/core/src/layers/logging.rs
+++ b/core/src/layers/logging.rs
@@ -230,7 +230,7 @@ impl LoggingInterceptor for DefaultLoggingInterceptor {
struct LoggingContext<'a>(&'a [(&'a str, &'a str)]);
-impl<'a> Display for LoggingContext<'a> {
+impl Display for LoggingContext<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for (i, (k, v)) in self.0.iter().enumerate() {
if i > 0 {
diff --git a/core/src/layers/metrics.rs b/core/src/layers/metrics.rs
index 94ec8ba7a..8e577536d 100644
--- a/core/src/layers/metrics.rs
+++ b/core/src/layers/metrics.rs
@@ -176,7 +176,7 @@ struct OperationLabels<'a> {
error: Option<ErrorKind>,
}
-impl<'a> OperationLabels<'a> {
+impl OperationLabels<'_> {
/// labels:
///
/// 1. `["scheme", "namespace", "root", "operation"]`
diff --git a/core/src/raw/oio/write/append_write.rs b/core/src/raw/oio/write/append_write.rs
index 06c72cc5e..9ff3d06b7 100644
--- a/core/src/raw/oio/write/append_write.rs
+++ b/core/src/raw/oio/write/append_write.rs
@@ -65,7 +65,6 @@ pub struct AppendWriter<W: AppendWrite> {
/// # Safety
///
/// wasm32 is a special target that we only have one event-loop for this state.
-
impl<W: AppendWrite> AppendWriter<W> {
/// Create a new AppendWriter.
pub fn new(inner: W) -> Self {
diff --git a/core/src/raw/oio/write/multipart_write.rs b/core/src/raw/oio/write/multipart_write.rs
index 2ce71ef4f..b692303c5 100644
--- a/core/src/raw/oio/write/multipart_write.rs
+++ b/core/src/raw/oio/write/multipart_write.rs
@@ -141,7 +141,6 @@ pub struct MultipartWriter<W: MultipartWrite> {
/// # Safety
///
/// wasm32 is a special target that we only have one event-loop for this state.
-
impl<W: MultipartWrite> MultipartWriter<W> {
/// Create a new MultipartWriter.
pub fn new(inner: W, executor: Option<Executor>, concurrent: usize) -> Self {
diff --git a/core/src/raw/serde_util.rs b/core/src/raw/serde_util.rs
index f34833a47..f64bebab6 100644
--- a/core/src/raw/serde_util.rs
+++ b/core/src/raw/serde_util.rs
@@ -95,7 +95,7 @@ impl Iterator for Pairs {
/// Pair is used to hold both key and value of a config for better error output.
struct Pair(String, String);
-impl<'de> IntoDeserializer<'de, de::value::Error> for Pair {
+impl IntoDeserializer<'_, de::value::Error> for Pair {
type Deserializer = Self;
fn into_deserializer(self) -> Self::Deserializer {
diff --git a/core/src/services/hdfs_native/backend.rs b/core/src/services/hdfs_native/backend.rs
index 131d93f81..11a43a037 100644
--- a/core/src/services/hdfs_native/backend.rs
+++ b/core/src/services/hdfs_native/backend.rs
@@ -32,7 +32,6 @@ use crate::*;
/// [Hadoop Distributed File System (HDFS™)](https://hadoop.apache.org/) support.
/// Using [Native Rust HDFS client](https://github.com/Kimahriman/hdfs-native).
-
impl Configurator for HdfsNativeConfig {
type Builder = HdfsNativeBuilder;
fn into_builder(self) -> Self::Builder {
diff --git a/core/src/services/pcloud/lister.rs b/core/src/services/pcloud/lister.rs
index 86ade4dd5..c3486b68a 100644
--- a/core/src/services/pcloud/lister.rs
+++ b/core/src/services/pcloud/lister.rs
@@ -84,10 +84,10 @@ impl oio::PageList for PcloudLister {
return Ok(());
}
- return Err(Error::new(
+ Err(Error::new(
ErrorKind::Unexpected,
String::from_utf8_lossy(&bs.to_bytes()),
- ));
+ ))
}
_ => Err(parse_error(resp)),
}
diff --git a/core/src/services/swift/error.rs b/core/src/services/swift/error.rs
index c9880194b..73afa4164 100644
--- a/core/src/services/swift/error.rs
+++ b/core/src/services/swift/error.rs
@@ -61,10 +61,10 @@ pub(super) fn parse_error(resp: Response<Buffer>) -> Error {
}
fn parse_error_response(resp: &Bytes) -> String {
- return match de::from_reader::<_, ErrorResponse>(resp.clone().reader()) {
+ match de::from_reader::<_, ErrorResponse>(resp.clone().reader()) {
Ok(swift_err) => swift_err.p,
Err(_) => String::from_utf8_lossy(resp).into_owned(),
- };
+ }
}
#[cfg(test)]