style: corrects the use of ';' to improve readability

- remove unnecessary semicolon
and enable lint warning: unnecessary semicolon
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_semicolon
- add `;` to the last statement for consitent formatting
and enable lint `clippy::semicolon_if_nothing_returned`
warning: consider adding a `;` to the last statement for consistent formatting
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#semicolon_if_nothing_returned
This commit is contained in:
Gwen Lg
2026-01-26 14:25:05 +01:00
committed by Alex
parent 08fd6e659f
commit f59a8b7f62
38 changed files with 71 additions and 69 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ impl ConsulDiscovery {
builder = builder.default_headers(headers);
}
}
};
}
let client: reqwest::Client = builder.build()?;
+2 -2
View File
@@ -66,7 +66,7 @@ pub async fn get_kubernetes_nodes(
.and_then(|k| NodeID::from_slice(&k[..]));
if let Some(pubkey) = pubkey {
ret.push((*pubkey, SocketAddr::new(node.spec.address, node.spec.port)))
ret.push((*pubkey, SocketAddr::new(node.spec.address, node.spec.port)));
}
}
@@ -108,7 +108,7 @@ pub async fn publish_kubernetes_node(
.await?;
} else {
nodes.create(&PostParams::default(), &node).await?;
};
}
Ok(())
}
+1 -1
View File
@@ -85,7 +85,7 @@ impl LayoutVersion {
let mut count = 0;
for nod in self.ring_assignment_data.iter() {
if i as u8 == *nod {
count += 1
count += 1;
}
}
return Ok(count);
+2 -2
View File
@@ -374,7 +374,7 @@ impl RpcHelper {
// reach quorum, start some new requests.
while send_all_at_once || successes.len() + resp_stream.len() < quorum {
if let Some(fut) = requests.next() {
resp_stream.push(fut)
resp_stream.push(fut);
} else {
break;
}
@@ -582,7 +582,7 @@ impl RpcHelper {
let mut vernodes = vec![];
for ver in layout.versions()?.iter() {
let nodes = ver.nodes_of(position);
vernodes.push(rpc_helper.request_order(current_layout, nodes))
vernodes.push(rpc_helper.request_order(current_layout, nodes));
}
let mut ret = if vernodes.len() == 1 {
+4 -4
View File
@@ -481,7 +481,7 @@ impl System {
.iter()
.filter(|(_, _, v)| matches!(v, NodeRoleV(Some(r)) if r.capacity.is_some()))
.map(|(n, _, _)| *n),
)
);
}
let storage_nodes_ok = storage_nodes.iter().filter(|x| node_up(x)).count();
@@ -682,7 +682,7 @@ impl System {
// Add peer list from list stored on disk
if let Ok(peers) = self.persist_peer_list.load_async().await {
ping_list.extend(peers.0.iter().map(|(id, addr)| ((*id).into(), *addr)))
ping_list.extend(peers.0.iter().map(|(id, addr)| ((*id).into(), *addr)));
}
// Fetch peer list from Consul
@@ -705,9 +705,9 @@ impl System {
match create_kubernetes_crd().await {
Ok(()) => (),
Err(e) => {
error!("Failed to create kubernetes custom resource: {}", e)
error!("Failed to create kubernetes custom resource: {}", e);
}
};
}
}
match get_kubernetes_nodes(k).await {
+2 -2
View File
@@ -60,7 +60,7 @@ impl SystemMetrics {
KeyValue::new("rustversion", garage_util::version::rust_version()),
KeyValue::new("version", garage_util::version::garage_version()),
],
)
);
})
.with_description("Garage build info")
.init(),
@@ -68,7 +68,7 @@ impl SystemMetrics {
let replication_factor = system.replication_factor;
meter
.u64_value_observer("garage_replication_factor", move |observer| {
observer.observe(usize::from(replication_factor) as u64, &[])
observer.observe(usize::from(replication_factor) as u64, &[]);
})
.with_description("Garage replication factor setting")
.init()