Skip to content

Commit

Permalink
chore: fix cargo clippy (#5384)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorgan authored Dec 3, 2024
1 parent a686ba3 commit d9807d1
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/src/layers/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/src/layers/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ struct OperationLabels<'a> {
error: Option<ErrorKind>,
}

impl<'a> OperationLabels<'a> {
impl OperationLabels<'_> {
/// labels:
///
/// 1. `["scheme", "namespace", "root", "operation"]`
Expand Down
1 change: 0 additions & 1 deletion core/src/raw/oio/write/append_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion core/src/raw/oio/write/multipart_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/src/raw/serde_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion core/src/services/hdfs_native/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions core/src/services/pcloud/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/services/swift/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit d9807d1

Please sign in to comment.