Skip to content

Commit

Permalink
Fix clippy::implicit_clone (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchahinRohani authored Oct 15, 2024
1 parent 257aedb commit 4001d12
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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,-Dclippy::semicolon_if_nothing_returned,-Dclippy::unreadable_literal,-Dclippy::range_plus_one,-Dclippy::inconsistent_struct_constructor,-Dclippy::match_wildcard_for_single_variants
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::semicolon_if_nothing_returned,-Dclippy::unreadable_literal,-Dclippy::range_plus_one,-Dclippy::inconsistent_struct_constructor,-Dclippy::match_wildcard_for_single_variants,-Dclippy::implicit_clone
build --@rules_rust//:clippy.toml=//:clippy.toml

test --@rules_rust//:rustfmt.toml=//:.rustfmt.toml
Expand Down
4 changes: 2 additions & 2 deletions nativelink-scheduler/src/grpc_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
})
Expand Down
2 changes: 1 addition & 1 deletion nativelink-store/src/filesystem_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}")
Expand Down
4 changes: 2 additions & 2 deletions nativelink-store/src/grpc_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
}))
Expand Down
4 changes: 2 additions & 2 deletions nativelink-store/src/s3_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
}
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4001d12

Please sign in to comment.