Skip to content

Commit

Permalink
Fix clippy::semicolon_if_nothing_returned (#1393)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchahinRohani authored Oct 7, 2024
1 parent e6eb5f7 commit 553f33c
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 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
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
build --@rules_rust//:clippy.toml=//:clippy.toml

test --@rules_rust//:rustfmt.toml=//:.rustfmt.toml
Expand Down
2 changes: 1 addition & 1 deletion nativelink-metric-collector/src/metrics_visitors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Visit for MetricDataVisitor {

fn record_f64(&mut self, field: &Field, value: f64) {
if field.name() == "__value" {
self.value = ValueWithPrimitiveType::String(value.to_string())
self.value = ValueWithPrimitiveType::String(value.to_string());
}
}
fn record_i64(&mut self, field: &Field, value: i64) {
Expand Down
2 changes: 1 addition & 1 deletion nativelink-scheduler/src/grpc_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl GrpcScheduler {
},
}
}
)
);
}
});

Expand Down
2 changes: 1 addition & 1 deletion nativelink-scheduler/src/store_awaited_action_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ impl SchedulerStoreDataProvider for UpdateOperationIdToAwaitedAction {
output.push((
"unique_qualifier",
Bytes::from(unique_qualifier.to_string()),
))
));
}
{
let state = SortedAwaitedActionState::try_from(&self.0.state().stage)
Expand Down
2 changes: 1 addition & 1 deletion nativelink-store/tests/filesystem_store_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl<Hooks: FileEntryHooks + 'static + Sync + Send> LenEntry for TestFileEntry<H

async fn unref(&self) {
Hooks::on_unref(self);
self.inner.as_ref().unwrap().unref().await
self.inner.as_ref().unwrap().unref().await;
}
}

Expand Down
2 changes: 1 addition & 1 deletion nativelink-store/tests/shard_store_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async fn verify_weights(
assert_eq!(
*expected_hit, total_hits,
"Index {index} failed with expected_hit: {expected_hit} != total_hits: {total_hits}"
)
);
}
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl ConnectionManagerWorker {
// beginning of the retry period. Never want to be in a
// situation where we give up on an Endpoint forever.
Err((identifier, _)) => {
self.connect_endpoint(identifier.endpoint_index, Some(identifier.connection_index))
self.connect_endpoint(identifier.endpoint_index, Some(identifier.connection_index));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/origin_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ pin_project! {
// `PinnedDrop::drop()` is guaranteed to be called only
// once.
unsafe {
ManuallyDrop::drop(this.inner.get_unchecked_mut())
ManuallyDrop::drop(this.inner.get_unchecked_mut());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl Retrier {
iter.next()
.ok_or(err.append(format!("On attempt {attempt}")))?,
)
.await
.await;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions nativelink-util/src/store_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ impl Hash for StoreKey<'_> {
match self {
StoreKey::Str(s) => {
(HashId::Str as u8).hash(state);
s.hash(state)
s.hash(state);
}
StoreKey::Digest(d) => {
(HashId::Digest as u8).hash(state);
d.hash(state)
d.hash(state);
}
}
}
Expand Down Expand Up @@ -333,7 +333,7 @@ impl Store {
/// Register health checks used to monitor the store.
#[inline]
pub fn register_health(&self, registry: &mut HealthRegistryBuilder) {
self.inner.clone().register_health(registry)
self.inner.clone().register_health(registry);
}
}

Expand Down
4 changes: 2 additions & 2 deletions nativelink-worker/src/running_actions_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1192,10 +1192,10 @@ impl RunningActionImpl {
OutputType::File(output_file) => output_files.push(output_file),
OutputType::Directory(output_folder) => output_folders.push(output_folder),
OutputType::FileSymlink(output_symlink) => {
output_file_symlinks.push(output_symlink)
output_file_symlinks.push(output_symlink);
}
OutputType::DirectorySymlink(output_symlink) => {
output_directory_symlinks.push(output_symlink)
output_directory_symlinks.push(output_symlink);
}
OutputType::None => { /* Safe to ignore */ }
}
Expand Down
4 changes: 2 additions & 2 deletions src/bin/nativelink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ async fn inner_main(
},
)
}),
)
);
}

if let Some(admin_config) = services.admin {
Expand Down Expand Up @@ -640,7 +640,7 @@ async fn inner_main(
},
),
),
)
);
}

// Configure our TLS acceptor if we have TLS configured.
Expand Down

0 comments on commit 553f33c

Please sign in to comment.