From 35ea7e4926299e346d066e1de7338ec1894bc6aa Mon Sep 17 00:00:00 2001 From: Tommy Verrall Date: Mon, 20 Oct 2025 16:51:07 +0200 Subject: [PATCH] - Add DEFAULT_NYM_API_RETRIES constant (replaces magic number 3) - Run cargo fmt on all affected packages - All clippy warnings resolved --- common/client-core/src/init/helpers.rs | 3 ++- nym-registration-client/src/builder/config.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/client-core/src/init/helpers.rs b/common/client-core/src/init/helpers.rs index 67a0769534..e574466701 100644 --- a/common/client-core/src/init/helpers.rs +++ b/common/client-core/src/init/helpers.rs @@ -45,6 +45,7 @@ type WsConn = JSWebsocket; const CONCURRENT_GATEWAYS_MEASURED: usize = 20; const MEASUREMENTS: usize = 3; +const DEFAULT_NYM_API_RETRIES: usize = 3; #[cfg(not(target_arch = "wasm32"))] const CONN_TIMEOUT: Duration = Duration::from_millis(1500); @@ -149,7 +150,7 @@ pub async fn gateways_for_init( return Err(ClientCoreError::ListOfNymApisIsEmpty); } - let retry_count = retry_count.unwrap_or(3); + let retry_count = retry_count.unwrap_or(DEFAULT_NYM_API_RETRIES); let mut builder = nym_http_api_client::ClientBuilder::new_with_urls(nym_api_urls.clone()) .with_retries(retry_count) .with_bincode(); diff --git a/nym-registration-client/src/builder/config.rs b/nym-registration-client/src/builder/config.rs index f19e981f5a..c3bbbf3668 100644 --- a/nym-registration-client/src/builder/config.rs +++ b/nym-registration-client/src/builder/config.rs @@ -256,7 +256,7 @@ fn true_to_disabled(val: bool) -> &'static str { /// Builder for `BuilderConfig` /// -/// This provides a more convinient way to construct a `BuilderConfig` compared to the +/// This provides a more convenient way to construct a `BuilderConfig` compared to the /// `new()` constructor with many arguments. #[derive(Default)] pub struct BuilderConfigBuilder {