Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit 4a240c1

Browse files
committed
autofix new issues
1 parent 0e81882 commit 4a240c1

3 files changed

Lines changed: 13 additions & 16 deletions

File tree

crates/validator/src/validators/hardware.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<'a> HardwareValidator<'a> {
9797

9898
pub async fn validate_nodes(&self, nodes: Vec<DiscoveryNode>) -> Result<()> {
9999
let non_validated: Vec<_> = nodes.into_iter().filter(|n| !n.is_validated).collect();
100-
debug!("Non validated nodes: {:?}", non_validated);
100+
debug!("Non validated nodes: {non_validated:?}");
101101
info!("Starting validation for {} nodes", non_validated.len());
102102

103103
let contracts = self.contracts.clone();
@@ -113,7 +113,7 @@ impl<'a> HardwareValidator<'a> {
113113
{
114114
Ok(_) => (),
115115
Err(e) => {
116-
error!("Failed to validate node {}: {}", node_id, e);
116+
error!("Failed to validate node {node_id}: {e}");
117117
}
118118
}
119119
}

crates/validator/src/validators/synthetic_data/mod.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,12 @@ impl SyntheticDataValidator<WalletProvider> {
475475
let work_info: Option<String> = con
476476
.get(&key)
477477
.await
478-
.map_err(|e| Error::msg(format!("Failed to get work info: {}", e)))?;
478+
.map_err(|e| Error::msg(format!("Failed to get work info: {e}")))?;
479479

480480
match work_info {
481481
Some(work_info_str) => {
482482
let work_info: WorkInfo = serde_json::from_str(&work_info_str)
483-
.map_err(|e| Error::msg(format!("Failed to parse work info: {}", e)))?;
483+
.map_err(|e| Error::msg(format!("Failed to parse work info: {e}")))?;
484484

485485
// Check if work_info has invalid values
486486
if !work_info.is_valid() {
@@ -889,7 +889,7 @@ impl SyntheticDataValidator<WalletProvider> {
889889
Ok(work_info) => {
890890
match !work_info.is_valid() {
891891
true => {
892-
error!("Got zero/default work info for key {}, likely not yet in contract", work_key);
892+
error!("Got zero/default work info for key {work_key}, likely not yet in contract");
893893
None
894894
}
895895
false => Some((work_key, work_info)),
@@ -1244,7 +1244,7 @@ impl SyntheticDataValidator<WalletProvider> {
12441244
}
12451245

12461246
pub async fn process_group_status_check(&self, group: ToplocGroup) -> Result<(), Error> {
1247-
println!("processing group status check: {:?}", group);
1247+
println!("processing group status check: {group:?}");
12481248
let toploc_config = self
12491249
.find_matching_toploc_config(&group.prefix)
12501250
.ok_or(Error::msg(format!(
@@ -1256,8 +1256,8 @@ impl SyntheticDataValidator<WalletProvider> {
12561256
.get_group_file_validation_status(&group.group_file_name)
12571257
.await?;
12581258
let toploc_config_name = toploc_config.name();
1259-
println!("toploc config name: {:?}", toploc_config_name);
1260-
println!("status: {:?}", status);
1259+
println!("toploc config name: {toploc_config_name:?}");
1260+
println!("status: {status:?}");
12611261

12621262
if let Some(metrics) = &self.metrics {
12631263
metrics.record_group_validation_status(
@@ -1282,8 +1282,8 @@ impl SyntheticDataValidator<WalletProvider> {
12821282

12831283
let mut toploc_nodes_to_invalidate = Vec::new();
12841284
let mut nodes_with_wrong_work_unit_claims = Vec::new();
1285-
println!("node_work_units: {:?}", node_work_units);
1286-
println!("total_claimed_units: {:?}", total_claimed_units);
1285+
println!("node_work_units: {node_work_units:?}");
1286+
println!("total_claimed_units: {total_claimed_units:?}");
12871287
println!("toploc status: {:?}", status.status);
12881288

12891289
if status.status == ValidationResult::Reject {
@@ -1303,12 +1303,10 @@ impl SyntheticDataValidator<WalletProvider> {
13031303
}
13041304

13051305
println!(
1306-
"toploc_nodes_to_invalidate: {:?}",
1307-
toploc_nodes_to_invalidate
1306+
"toploc_nodes_to_invalidate: {toploc_nodes_to_invalidate:?}"
13081307
);
13091308
println!(
1310-
"nodes_with_wrong_work_unit_claims: {:?}",
1311-
nodes_with_wrong_work_unit_claims
1309+
"nodes_with_wrong_work_unit_claims: {nodes_with_wrong_work_unit_claims:?}"
13121310
);
13131311

13141312
for work_key in &group.sorted_work_keys {

crates/worker/src/docker/docker_manager.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,7 @@ impl DockerManager {
397397
"host".to_string()
398398
};
399399

400-
let host_config = if gpu.is_some() {
401-
let gpu = gpu.unwrap();
400+
let host_config = if let Some(gpu) = gpu {
402401
let device_ids = match &gpu.indices {
403402
Some(indices) if !indices.is_empty() => {
404403
// Use specific GPU indices if available

0 commit comments

Comments
 (0)