From 6df746fd9926320182edd616cd8bdf04e663d4e7 Mon Sep 17 00:00:00 2001 From: Schahin Rouhanizadeh Date: Wed, 2 Oct 2024 19:13:44 +0200 Subject: [PATCH] Fix clippy::implicit_clone --- .bazelrc | 2 +- nativelink-scheduler/src/grpc_scheduler.rs | 4 ++-- nativelink-store/src/filesystem_store.rs | 2 +- nativelink-store/src/grpc_store.rs | 4 ++-- nativelink-store/src/s3_store.rs | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.bazelrc b/.bazelrc index 11fca67e7..f7e64b7dc 100644 --- a/.bazelrc +++ b/.bazelrc @@ -45,7 +45,7 @@ build --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect # TODO(aaronmondal): Extend these flags until we can run with clippy::pedantic. -build --@rules_rust//:clippy_flags=-Dwarnings,-Dclippy::uninlined_format_args,-Dclippy::manual_string_new,-Dclippy::manual_let_else,-Dclippy::single_match_else,-Dclippy::redundant_closure_for_method_calls +build --@rules_rust//:clippy_flags=-Dwarnings,-Dclippy::uninlined_format_args,-Dclippy::manual_string_new,-Dclippy::manual_let_else,-Dclippy::single_match_else,-Dclippy::redundant_closure_for_method_calls,-Dclippy::implicit_clone build --@rules_rust//:clippy.toml=//:clippy.toml test --@rules_rust//:rustfmt.toml=//:.rustfmt.toml diff --git a/nativelink-scheduler/src/grpc_scheduler.rs b/nativelink-scheduler/src/grpc_scheduler.rs index 505b29011..88e992452 100644 --- a/nativelink-scheduler/src/grpc_scheduler.rs +++ b/nativelink-scheduler/src/grpc_scheduler.rs @@ -117,13 +117,13 @@ impl GrpcScheduler { retrier: Retrier::new( Arc::new(|duration| Box::pin(sleep(duration))), jitter_fn.clone(), - config.retry.to_owned(), + config.retry.clone(), ), connection_manager: ConnectionManager::new( std::iter::once(endpoint), config.connections_per_endpoint, config.max_concurrent_requests, - config.retry.to_owned(), + config.retry.clone(), jitter_fn, ), }) diff --git a/nativelink-store/src/filesystem_store.rs b/nativelink-store/src/filesystem_store.rs index faadbb04c..924edca79 100644 --- a/nativelink-store/src/filesystem_store.rs +++ b/nativelink-store/src/filesystem_store.rs @@ -324,7 +324,7 @@ impl LenEntry for FileEntryImpl { async fn touch(&self) -> bool { let result = self .get_file_path_locked(move |full_content_path| async move { - let full_content_path = full_content_path.to_os_string(); + let full_content_path = full_content_path.clone(); spawn_blocking!("filesystem_touch_set_mtime", move || { set_file_atime(&full_content_path, FileTime::now()).err_tip(|| { format!("Failed to touch file in filesystem store {full_content_path:?}") diff --git a/nativelink-store/src/grpc_store.rs b/nativelink-store/src/grpc_store.rs index b08b2ef76..e1c1f9caf 100644 --- a/nativelink-store/src/grpc_store.rs +++ b/nativelink-store/src/grpc_store.rs @@ -108,13 +108,13 @@ impl GrpcStore { retrier: Retrier::new( Arc::new(|duration| Box::pin(sleep(duration))), jitter_fn.clone(), - config.retry.to_owned(), + config.retry.clone(), ), connection_manager: ConnectionManager::new( endpoints.into_iter(), config.connections_per_endpoint, config.max_concurrent_requests, - config.retry.to_owned(), + config.retry.clone(), jitter_fn, ), })) diff --git a/nativelink-store/src/s3_store.rs b/nativelink-store/src/s3_store.rs index 699e4684d..8e62d2a1d 100644 --- a/nativelink-store/src/s3_store.rs +++ b/nativelink-store/src/s3_store.rs @@ -164,7 +164,7 @@ impl TlsConnector { retrier: Retrier::new( Arc::new(|duration| Box::pin(sleep(duration))), jitter_fn, - config.retry.to_owned(), + config.retry.clone(), ), } } @@ -312,7 +312,7 @@ where retrier: Retrier::new( Arc::new(|duration| Box::pin(sleep(duration))), jitter_fn, - config.retry.to_owned(), + config.retry.clone(), ), consider_expired_after_s: i64::from(config.consider_expired_after_s), max_retry_buffer_per_request: config