diff --git a/core/src/layers/logging.rs b/core/src/layers/logging.rs index ec929e50d63b..30ec40ebb689 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 94ec8ba7ad54..8e577536d894 100644 --- a/core/src/layers/metrics.rs +++ b/core/src/layers/metrics.rs @@ -176,7 +176,7 @@ struct OperationLabels<'a> { error: Option, } -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 06c72cc5e2cc..9ff3d06b7c1a 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 { /// # Safety /// /// wasm32 is a special target that we only have one event-loop for this state. - impl AppendWriter { /// 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 2ce71ef4fe78..b692303c5b60 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 { /// # Safety /// /// wasm32 is a special target that we only have one event-loop for this state. - impl MultipartWriter { /// Create a new MultipartWriter. pub fn new(inner: W, executor: Option, concurrent: usize) -> Self { diff --git a/core/src/raw/serde_util.rs b/core/src/raw/serde_util.rs index f34833a47d1c..f64bebab6a0f 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 131d93f814b9..11a43a0378f2 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 86ade4dd580e..c3486b68a88d 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 c9880194b53b..73afa41645c7 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) -> 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)]