Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix cargo clippy #5384

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading