diff --git a/common/client-libs/validator-client/src/client.rs b/common/client-libs/validator-client/src/client.rs index 4a3653fb21..2caf379fe6 100644 --- a/common/client-libs/validator-client/src/client.rs +++ b/common/client-libs/validator-client/src/client.rs @@ -25,6 +25,7 @@ use validator_api_requests::models::{ }; #[cfg(feature = "nymd-client")] +#[must_use] pub struct Config { api_url: Url, nymd_url: Url, diff --git a/common/client-libs/validator-client/src/nymd/wallet/mod.rs b/common/client-libs/validator-client/src/nymd/wallet/mod.rs index 195ebc9239..8abbccb7a0 100644 --- a/common/client-libs/validator-client/src/nymd/wallet/mod.rs +++ b/common/client-libs/validator-client/src/nymd/wallet/mod.rs @@ -133,6 +133,7 @@ impl DirectSecp256k1HdWallet { } } +#[must_use] pub struct DirectSecp256k1HdWalletBuilder { /// The password to use when deriving a BIP39 seed from a mnemonic. bip39_password: String, diff --git a/common/client-libs/validator-client/src/validator_api/mod.rs b/common/client-libs/validator-client/src/validator_api/mod.rs index 528f3b9939..c30a76b174 100644 --- a/common/client-libs/validator-client/src/validator_api/mod.rs +++ b/common/client-libs/validator-client/src/validator_api/mod.rs @@ -112,7 +112,7 @@ impl Client { routes::MIXNODES, routes::REWARDED, routes::INCLUSION_CHANCE, - &mixnode_id.to_string(), + mixnode_id, ], NO_PARAMS, ) diff --git a/common/mixnode-common/src/verloc/mod.rs b/common/mixnode-common/src/verloc/mod.rs index 52060cb804..623bdc9e18 100644 --- a/common/mixnode-common/src/verloc/mod.rs +++ b/common/mixnode-common/src/verloc/mod.rs @@ -77,6 +77,7 @@ impl Config { } } +#[must_use] pub struct ConfigBuilder(Config); impl ConfigBuilder { diff --git a/common/nymsphinx/src/preparer/mod.rs b/common/nymsphinx/src/preparer/mod.rs index 63d2f67559..3f56f9bada 100644 --- a/common/nymsphinx/src/preparer/mod.rs +++ b/common/nymsphinx/src/preparer/mod.rs @@ -54,6 +54,7 @@ impl From for PreparationError { /// an optional reply-SURB, padding it to appropriate length, encrypting its content, /// and chunking into appropriate size [`Fragment`]s. #[cfg_attr(not(target_arch = "wasm32"), derive(Clone))] +#[must_use] pub struct MessagePreparer { /// Instance of a cryptographically secure random number generator. rng: R, diff --git a/common/nymsphinx/src/receiver.rs b/common/nymsphinx/src/receiver.rs index d06afa9a91..1707983ca3 100644 --- a/common/nymsphinx/src/receiver.rs +++ b/common/nymsphinx/src/receiver.rs @@ -58,6 +58,7 @@ impl MessageReceiver { } /// Allows setting non-default number of expected mix hops in the network. + #[must_use] pub fn with_mix_hops(mut self, hops: u8) -> Self { self.num_mix_hops = hops; self diff --git a/common/topology/src/filter.rs b/common/topology/src/filter.rs index 652b5f92e9..6c1a3c2fe1 100644 --- a/common/topology/src/filter.rs +++ b/common/topology/src/filter.rs @@ -9,6 +9,7 @@ pub trait Versioned: Clone { } pub trait VersionFilterable { + #[must_use] fn filter_by_version(&self, expected_version: &str) -> Self; } diff --git a/common/topology/src/lib.rs b/common/topology/src/lib.rs index c14256512a..7d5b9843d4 100644 --- a/common/topology/src/lib.rs +++ b/common/topology/src/lib.rs @@ -206,10 +206,12 @@ impl NymTopology { true } + #[must_use] pub fn filter_system_version(&self, expected_version: &str) -> Self { self.filter_node_versions(expected_version, expected_version) } + #[must_use] pub fn filter_node_versions( &self, expected_mix_version: &str,