From f59a8b7f621b0abf8c8e31b7cdd8994a7154b16c Mon Sep 17 00:00:00 2001 From: Gwen Lg Date: Mon, 26 Jan 2026 14:25:05 +0100 Subject: [PATCH] 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 --- Cargo.toml | 2 ++ src/api/admin/bucket.rs | 8 ++++---- src/api/admin/openapi.rs | 2 +- src/api/admin/router_v0.rs | 2 +- src/api/admin/router_v1.rs | 2 +- src/api/admin/router_v2.rs | 2 +- src/api/common/generic_server.rs | 4 ++-- src/api/common/signature/body.rs | 2 +- src/api/k2v/router.rs | 2 +- src/api/s3/encryption.rs | 4 ++-- src/api/s3/list.rs | 10 +++++----- src/api/s3/multipart.rs | 2 +- src/api/s3/put.rs | 8 ++++---- src/api/s3/router.rs | 8 ++++---- src/block/layout.rs | 2 +- src/block/metrics.rs | 4 ++-- src/block/rc.rs | 6 +++--- src/block/repair.rs | 8 ++++---- src/block/resync.rs | 2 +- src/db/sqlite_adapter.rs | 2 +- src/garage/cli/remote/layout.rs | 2 +- src/garage/cli/remote/worker.rs | 2 +- src/garage/tests/s3/list.rs | 4 ++-- src/model/helper/locked.rs | 2 +- src/model/k2v/seen.rs | 2 +- src/net/client.rs | 2 +- src/net/error.rs | 2 +- src/net/netapp.rs | 2 +- src/net/recv.rs | 2 +- src/net/send.rs | 4 ++-- src/net/test.rs | 4 ++-- src/rpc/consul.rs | 2 +- src/rpc/kubernetes.rs | 4 ++-- src/rpc/layout/version.rs | 2 +- src/rpc/rpc_helper.rs | 4 ++-- src/rpc/system.rs | 8 ++++---- src/rpc/system_metrics.rs | 4 ++-- src/web/web_server.rs | 6 +++--- 38 files changed, 71 insertions(+), 69 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6d701055..6bd3d32a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -183,3 +183,5 @@ strip = "debuginfo" [workspace.lints.clippy] # pedantic lints configuration doc_markdown = "warn" +semicolon_if_nothing_returned = "warn" +unnecessary_semicolon = "warn" diff --git a/src/api/admin/bucket.rs b/src/api/admin/bucket.rs index 046ed44c..61be02d9 100644 --- a/src/api/admin/bucket.rs +++ b/src/api/admin/bucket.rs @@ -557,7 +557,7 @@ impl RequestHandler for AddBucketAliasRequest { BucketAliasEnum::Global { global_alias } => { helper .set_global_bucket_alias(bucket_id, &global_alias) - .await? + .await?; } BucketAliasEnum::Local { local_alias, @@ -565,7 +565,7 @@ impl RequestHandler for AddBucketAliasRequest { } => { helper .set_local_bucket_alias(bucket_id, &access_key_id, &local_alias) - .await? + .await?; } } @@ -591,7 +591,7 @@ impl RequestHandler for RemoveBucketAliasRequest { BucketAliasEnum::Global { global_alias } => { helper .unset_global_bucket_alias(bucket_id, &global_alias) - .await? + .await?; } BucketAliasEnum::Local { local_alias, @@ -599,7 +599,7 @@ impl RequestHandler for RemoveBucketAliasRequest { } => { helper .unset_local_bucket_alias(bucket_id, &access_key_id, &local_alias) - .await? + .await?; } } diff --git a/src/api/admin/openapi.rs b/src/api/admin/openapi.rs index c5936ade..c205213b 100644 --- a/src/api/admin/openapi.rs +++ b/src/api/admin/openapi.rs @@ -869,7 +869,7 @@ impl Modify for SecurityAddon { components.add_security_scheme( "bearerAuth", SecurityScheme::Http(Http::builder().scheme(HttpAuthScheme::Bearer).build()), - ) + ); } } diff --git a/src/api/admin/router_v0.rs b/src/api/admin/router_v0.rs index 168c21d3..89390666 100644 --- a/src/api/admin/router_v0.rs +++ b/src/api/admin/router_v0.rs @@ -124,7 +124,7 @@ impl Endpoint { ]); if let Some(message) = query.nonempty_message() { - debug!("Unused query parameter: {}", message) + debug!("Unused query parameter: {}", message); } Ok(res) diff --git a/src/api/admin/router_v1.rs b/src/api/admin/router_v1.rs index 2fdb996d..79e4fac4 100644 --- a/src/api/admin/router_v1.rs +++ b/src/api/admin/router_v1.rs @@ -126,7 +126,7 @@ impl Endpoint { ]); if let Some(message) = query.nonempty_message() { - debug!("Unused query parameter: {}", message) + debug!("Unused query parameter: {}", message); } Ok(res) diff --git a/src/api/admin/router_v2.rs b/src/api/admin/router_v2.rs index 7fcce6e7..3a9a567d 100644 --- a/src/api/admin/router_v2.rs +++ b/src/api/admin/router_v2.rs @@ -89,7 +89,7 @@ impl AdminApiRequest { ]); if let Some(message) = query.nonempty_message() { - debug!("Unused query parameter: {}", message) + debug!("Unused query parameter: {}", message); } Ok(res) diff --git a/src/api/common/generic_server.rs b/src/api/common/generic_server.rs index 181b6231..0e97334a 100644 --- a/src/api/common/generic_server.rs +++ b/src/api/common/generic_server.rs @@ -125,7 +125,7 @@ impl ApiServer { } UnixOrTCPSocketAddress::UnixSocket(ref path) => { if path.exists() { - fs::remove_file(path)? + fs::remove_file(path)?; } let listener = UnixListener::bind(path)?; @@ -190,7 +190,7 @@ impl ApiServer { let mut http_error_builder = Response::builder().status(e.http_status_code()); if let Some(header_map) = http_error_builder.headers_mut() { - e.add_http_headers(header_map) + e.add_http_headers(header_map); } let http_error = http_error_builder.body(body)?; diff --git a/src/api/common/signature/body.rs b/src/api/common/signature/body.rs index 96be0d5b..0bace5ef 100644 --- a/src/api/common/signature/body.rs +++ b/src/api/common/signature/body.rs @@ -89,7 +89,7 @@ impl ReqBody { checksummer }) .await - .unwrap() + .unwrap(); } Err(frame) => { let trailers = frame.into_trailers().unwrap(); diff --git a/src/api/k2v/router.rs b/src/api/k2v/router.rs index 241bb9d2..4e50bfa6 100644 --- a/src/api/k2v/router.rs +++ b/src/api/k2v/router.rs @@ -90,7 +90,7 @@ impl Endpoint { }; if let Some(message) = query.nonempty_message() { - debug!("Unused query parameter: {}", message) + debug!("Unused query parameter: {}", message); } Ok((res, bucket)) } diff --git a/src/api/s3/encryption.rs b/src/api/s3/encryption.rs index 0312754e..1723b762 100644 --- a/src/api/s3/encryption.rs +++ b/src/api/s3/encryption.rs @@ -660,11 +660,11 @@ mod tests { #[tokio::test] async fn test_encrypt_block() { - test_block_enc(None).await + test_block_enc(None).await; } #[tokio::test] async fn test_encrypt_block_compressed() { - test_block_enc(Some(1)).await + test_block_enc(Some(1)).await; } } diff --git a/src/api/s3/list.rs b/src/api/s3/list.rs index f306a1e5..67d9922e 100644 --- a/src/api/s3/list.rs +++ b/src/api/s3/list.rs @@ -484,7 +484,7 @@ where iter.next(); } _ => (), - }; + } while let Some(object) = iter.peek() { if !object.key.starts_with(&query.prefix) { @@ -508,7 +508,7 @@ where ExtractionResult::NoMore => { return Ok(None); } - }; + } } if !server_more { @@ -756,7 +756,7 @@ impl Accumulator { None => Some(ExtractionResult::NoMore), } } - }; + } } } @@ -1069,7 +1069,7 @@ mod tests { assert_eq!(upload, Uuid::from([0x8f; 32])); } _ => panic!("wrong result"), - }; + } assert_eq!(acc.keys.len(), 2); assert_eq!( @@ -1098,7 +1098,7 @@ mod tests { match acc.extract(&(query().common), &start, &mut iter) { ExtractionResult::Extracted { key } if key.as_str() == "b" => (), _ => panic!("wrong result"), - }; + } } #[tokio::test] diff --git a/src/api/s3/multipart.rs b/src/api/s3/multipart.rs index fb246041..5e56408f 100644 --- a/src/api/s3/multipart.rs +++ b/src/api/s3/multipart.rs @@ -370,7 +370,7 @@ pub async fn handle_complete_multipart_upload( req_part.part_number, req_part.checksum, part.checksum ))); } - parts.push(*part) + parts.push(*part); } _ => return Err(Error::InvalidPart), } diff --git a/src/api/s3/put.rs b/src/api/s3/put.rs index 27f85697..303a586b 100644 --- a/src/api/s3/put.rs +++ b/src/api/s3/put.rs @@ -192,7 +192,7 @@ pub(crate) async fn save_stream> + Unpin>( meta.checksum = checksums.extract(Some(algo)); } } - }; + } let size = first_block.len() as u64; check_quotas(ctx, size, existing_object.as_ref()).await?; @@ -293,7 +293,7 @@ pub(crate) async fn save_stream> + Unpin>( meta.checksum = checksums.extract(Some(algo)); } } - }; + } // Verify quotas are respsected check_quotas(ctx, total_size, existing_object.as_ref()).await?; @@ -339,7 +339,7 @@ pub(crate) async fn check_quotas( let quotas = bucket_params.quotas.get(); if quotas.max_objects.is_none() && quotas.max_size.is_none() { return Ok(()); - }; + } let counters = garage .object_counter_table @@ -436,7 +436,7 @@ pub(crate) async fn read_and_put_blocks> + tracer.start("Hash block (md5, sha256)"), )) .await - .unwrap() + .unwrap(); } Err(e) => { block_tx2.send(Err(e)).await?; diff --git a/src/api/s3/router.rs b/src/api/s3/router.rs index ca01c3cd..3f2d9208 100644 --- a/src/api/s3/router.rs +++ b/src/api/s3/router.rs @@ -365,7 +365,7 @@ impl Endpoint { } if let Some(message) = query.nonempty_message() { - debug!("Unused query parameter: {}", message) + debug!("Unused query parameter: {}", message); } Ok((res, Some(bucket))) } @@ -580,7 +580,7 @@ impl Endpoint { pub fn authorization_type(&self) -> Authorization { if let Endpoint::ListBuckets = self { return Authorization::None; - }; + } let readonly = router_match! { @match self, @@ -725,7 +725,7 @@ mod tests { ) -> (Endpoint, Option) { let mut req = Request::builder().method(method).uri(uri); if let Some((k, v)) = header { - req = req.header(k, v) + req = req.header(k, v); } let req = req.body(()).unwrap(); @@ -859,7 +859,7 @@ mod tests { .body(()) .unwrap(); - assert!(Endpoint::from_request(&req, None).is_err()) + assert!(Endpoint::from_request(&req, None).is_err()); } #[test] diff --git a/src/block/layout.rs b/src/block/layout.rs index 918b556e..dd153d6e 100644 --- a/src/block/layout.rs +++ b/src/block/layout.rs @@ -159,7 +159,7 @@ impl DataLayout { for (idir, parts) in dir_prim.iter().enumerate() { for part in parts.iter() { assert!(part_prim[*part].is_none()); - part_prim[*part] = Some(idir as Idx) + part_prim[*part] = Some(idir as Idx); } } diff --git a/src/block/metrics.rs b/src/block/metrics.rs index ffed7d1d..7a07018c 100644 --- a/src/block/metrics.rs +++ b/src/block/metrics.rs @@ -52,7 +52,7 @@ impl BlockManagerMetrics { _rc_size: meter .u64_value_observer("block.rc_size", move |observer| { if let Ok(value) = rc_tree.approximate_len() { - observer.observe(value as u64, &[]) + observer.observe(value as u64, &[]); } }) .with_description("Number of blocks known to the reference counter") @@ -78,7 +78,7 @@ impl BlockManagerMetrics { _buffer_free_kb: meter .u64_value_observer("block.ram_buffer_free_kb", move |observer| { - observer.observe(buffer_semaphore.available_permits() as u64, &[]) + observer.observe(buffer_semaphore.available_permits() as u64, &[]); }) .with_description( "Available RAM in KiB to use for buffering data blocks to be written to remote nodes", diff --git a/src/block/rc.rs b/src/block/rc.rs index 24f67cf2..881df68b 100644 --- a/src/block/rc.rs +++ b/src/block/rc.rs @@ -37,7 +37,7 @@ impl BlockRc { match old_rc.increment().serialize() { Some(x) => tx.insert(&self.rc_table, hash, x)?, None => unreachable!(), - }; + } Ok(old_rc.is_zero()) } @@ -52,7 +52,7 @@ impl BlockRc { match new_rc.serialize() { Some(x) => tx.insert(&self.rc_table, hash, x)?, None => tx.remove(&self.rc_table, hash)?, - }; + } Ok(matches!(new_rc, RcEntry::Deletable { .. })) } @@ -72,7 +72,7 @@ impl BlockRc { tx.remove(&self.rc_table, hash)?; } _ => (), - }; + } Ok(()) })?; Ok(()) diff --git a/src/block/repair.rs b/src/block/repair.rs index e467229f..343574f8 100644 --- a/src/block/repair.rs +++ b/src/block/repair.rs @@ -127,7 +127,7 @@ impl Worker for RepairWorker { self.manager .resync .put_to_resync(&hash, Duration::from_secs(0))?; - self.next_start = Some(hash) + self.next_start = Some(hash); } Ok(WorkerState::Busy) @@ -440,7 +440,7 @@ impl Worker for ScrubWorker { Ok(cmd) => self.handle_cmd(cmd).await, Err(mpsc::error::TryRecvError::Disconnected) => return Ok(WorkerState::Done), Err(mpsc::error::TryRecvError::Empty) => (), - }; + } match &mut self.work { ScrubWorkerState::Running { iterator, t_cp } => { @@ -455,7 +455,7 @@ impl Worker for ScrubWorker { } Err(e) => return Err(e), _ => (), - }; + } if now - *t_cp > 60 * 1000 { self.persister @@ -570,7 +570,7 @@ impl Worker for RebalanceWorker { format!("Started: {}", msec_to_rfc3339(self.t_started)), ]; if let Some(t_fin) = self.t_finished { - freeform.push(format!("Finished: {}", msec_to_rfc3339(t_fin))) + freeform.push(format!("Finished: {}", msec_to_rfc3339(t_fin))); } WorkerStatus { progress: Some(format!("{:.2}%", self.block_iter.progress() * 100.)), diff --git a/src/block/resync.rs b/src/block/resync.rs index 28666a71..003c1172 100644 --- a/src/block/resync.rs +++ b/src/block/resync.rs @@ -588,7 +588,7 @@ impl Worker for ResyncWorker { async fn wait_for_work(&mut self) -> WorkerState { while self.index >= self.persister.get_with(|x| x.n_workers) { - self.manager.resync.notify.notified().await + self.manager.resync.notify.notified().await; } select! { diff --git a/src/db/sqlite_adapter.rs b/src/db/sqlite_adapter.rs index 832dab14..b640e273 100644 --- a/src/db/sqlite_adapter.rs +++ b/src/db/sqlite_adapter.rs @@ -564,7 +564,7 @@ fn bounds_sql<'r>(low: Bound<&'r [u8]>, high: Bound<&'r [u8]>) -> (String, Vec (), - }; + } match high { Bound::Included(b) => { diff --git a/src/garage/cli/remote/layout.rs b/src/garage/cli/remote/layout.rs index fe0e3713..10be1029 100644 --- a/src/garage/cli/remote/layout.rs +++ b/src/garage/cli/remote/layout.rs @@ -394,7 +394,7 @@ pub fn print_cluster_layout(layout: &GetClusterLayoutResponse, empty_msg: &str) role.zone, capacity_string(role.capacity), )); - }; + } } if table.len() > 1 { format_table(table); diff --git a/src/garage/cli/remote/worker.rs b/src/garage/cli/remote/worker.rs index 45f0b3cd..f1cf1636 100644 --- a/src/garage/cli/remote/worker.rs +++ b/src/garage/cli/remote/worker.rs @@ -102,7 +102,7 @@ impl Cli { s => { table.push(format!("Worker state:\t{}", format_worker_state(s))); } - }; + } if let Some(tql) = info.tranquility { table.push(format!("Tranquility:\t{}", tql)); } diff --git a/src/garage/tests/s3/list.rs b/src/garage/tests/s3/list.rs index 1b0c006d..8b423a55 100644 --- a/src/garage/tests/s3/list.rs +++ b/src/garage/tests/s3/list.rs @@ -123,7 +123,7 @@ async fn test_listobjectsv2() { (Some(k), None) if k.len() == 1 => cnt_key += 1, (None, Some(pfx)) if pfx.len() == 1 => cnt_pfx += 1, _ => unreachable!("logic error"), - }; + } if next.is_none() { break; } @@ -331,7 +331,7 @@ async fn test_listobjectsv1() { (Some(k), None) if k.len() == 1 => cnt_key += 1, (None, Some(pfx)) if pfx.len() == 1 => cnt_pfx += 1, _ => unreachable!("logic error"), - }; + } if next.is_none() { break; } diff --git a/src/model/helper/locked.rs b/src/model/helper/locked.rs index 62d8505e..a1ad5b2b 100644 --- a/src/model/helper/locked.rs +++ b/src/model/helper/locked.rs @@ -37,7 +37,7 @@ pub struct LockedHelper<'a>( impl<'a> Drop for LockedHelper<'a> { fn drop(&mut self) { // make it explicit that the mutexguard lives until here - drop(self.1.take()) + drop(self.1.take()); } } diff --git a/src/model/k2v/seen.rs b/src/model/k2v/seen.rs index ad38c6ae..9616fcb4 100644 --- a/src/model/k2v/seen.rs +++ b/src/model/k2v/seen.rs @@ -71,7 +71,7 @@ impl RangeSeenMarker { pub fn canonicalize(&mut self) { let self_vc = &self.vector_clock; - self.items.retain(|_sk, vc| vclock_gt(vc, self_vc)) + self.items.retain(|_sk, vc| vclock_gt(vc, self_vc)); } pub fn encode(&mut self) -> Result { diff --git a/src/net/client.rs b/src/net/client.rs index bdb1e6c4..5834b4ab 100644 --- a/src/net/client.rs +++ b/src/net/client.rs @@ -277,7 +277,7 @@ impl Stream for CancelOnDropStream { let res = this.stream.poll_next(cx); if matches!(res, Poll::Ready(None)) { if let Some(c) = this.cancel.take() { - std::mem::forget(c) + std::mem::forget(c); } } res diff --git a/src/net/error.rs b/src/net/error.rs index f67794ed..7010d51e 100644 --- a/src/net/error.rs +++ b/src/net/error.rs @@ -72,7 +72,7 @@ where fn log_err(self, msg: &'static str) { if let Err(e) = self { error!("Error: {}: {}", msg, Into::::into(e)); - }; + } } } diff --git a/src/net/netapp.rs b/src/net/netapp.rs index 5ffc2d7f..14d0b53b 100644 --- a/src/net/netapp.rs +++ b/src/net/netapp.rs @@ -180,7 +180,7 @@ impl NetApp { .is_some() { panic!("Redefining endpoint: {}", path); - }; + } endpoint } diff --git a/src/net/recv.rs b/src/net/recv.rs index b7acb612..1a00ecf6 100644 --- a/src/net/recv.rs +++ b/src/net/recv.rs @@ -70,7 +70,7 @@ pub(crate) trait RecvLoop: Sync + 'static { Ok(_) => (), Err(e) if e.kind() == std::io::ErrorKind::UnexpectedEof => break, Err(e) => return Err(e.into()), - }; + } let id = RequestID::from_be_bytes(header_id); let mut header_size = [0u8; ChunkLength::BITS as usize / 8]; diff --git a/src/net/send.rs b/src/net/send.rs index 16248f66..cf040888 100644 --- a/src/net/send.rs +++ b/src/net/send.rs @@ -319,7 +319,7 @@ pub(crate) trait SendLoop: Sync { order_tag, data: ByteStreamReader::new(data), sent: 0, - }) + }); } Some(SendItem::Cancel(id)) => { trace!("send_loop({}): cancelling {}", debug_name, id); @@ -332,7 +332,7 @@ pub(crate) trait SendLoop: Sync { None => { msg_recv = None; } - }; + } } (id, data) = send_fut => { trace!( diff --git a/src/net/test.rs b/src/net/test.rs index 3cf446bd..bb45741b 100644 --- a/src/net/test.rs +++ b/src/net/test.rs @@ -15,12 +15,12 @@ use crate::NodeID; #[tokio::test(flavor = "current_thread")] async fn test_with_basic_scheduler() { pretty_env_logger::init(); - run_test(19980).await + run_test(19980).await; } #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_with_threaded_scheduler() { - run_test(19990).await + run_test(19990).await; } async fn run_test(port_base: u16) { diff --git a/src/rpc/consul.rs b/src/rpc/consul.rs index 9391e220..7aac4277 100644 --- a/src/rpc/consul.rs +++ b/src/rpc/consul.rs @@ -118,7 +118,7 @@ impl ConsulDiscovery { builder = builder.default_headers(headers); } } - }; + } let client: reqwest::Client = builder.build()?; diff --git a/src/rpc/kubernetes.rs b/src/rpc/kubernetes.rs index 85254bb5..f15afae0 100644 --- a/src/rpc/kubernetes.rs +++ b/src/rpc/kubernetes.rs @@ -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(()) } diff --git a/src/rpc/layout/version.rs b/src/rpc/layout/version.rs index 06a1392c..be2f98f3 100644 --- a/src/rpc/layout/version.rs +++ b/src/rpc/layout/version.rs @@ -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); diff --git a/src/rpc/rpc_helper.rs b/src/rpc/rpc_helper.rs index d7ec5242..0805c1cb 100644 --- a/src/rpc/rpc_helper.rs +++ b/src/rpc/rpc_helper.rs @@ -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 { diff --git a/src/rpc/system.rs b/src/rpc/system.rs index 06633b78..0cd301ff 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -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 { diff --git a/src/rpc/system_metrics.rs b/src/rpc/system_metrics.rs index 23957399..3d6c6e8b 100644 --- a/src/rpc/system_metrics.rs +++ b/src/rpc/system_metrics.rs @@ -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() diff --git a/src/web/web_server.rs b/src/web/web_server.rs index f50e4ca7..2d0cac2d 100644 --- a/src/web/web_server.rs +++ b/src/web/web_server.rs @@ -106,7 +106,7 @@ impl WebServer { } UnixOrTCPSocketAddress::UnixSocket(ref path) => { if path.exists() { - fs::remove_file(path)? + fs::remove_file(path)?; } let listener = UnixListener::bind(path)?; @@ -684,10 +684,10 @@ fn compute_redirect_target(redirect: &bucket_table::Redirect, suffix: Option<&st if let Some(replace_key_prefix) = &redirect.replace_key_prefix { res.push_str(replace_key_prefix); if let Some(suffix) = suffix { - res.push_str(suffix) + res.push_str(suffix); } } else if let Some(replace_key) = &redirect.replace_key { - res.push_str(replace_key) + res.push_str(replace_key); } res }