From 2e89af872ddb97d333295aaab52b571a3eb253df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Dimitroff=20H=C3=B3di?= Date: Mon, 19 Feb 2024 10:16:12 -0300 Subject: [PATCH] Fixed clippy suggestions --- node/tools/src/config.rs | 1 + node/tools/src/rpc/methods/config.rs | 1 + node/tools/src/tests.rs | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/node/tools/src/config.rs b/node/tools/src/config.rs index 4c17bc0d..55439d32 100644 --- a/node/tools/src/config.rs +++ b/node/tools/src/config.rs @@ -34,6 +34,7 @@ pub(crate) fn encode_json(x: &T) -> String { encode_with_serializer(x, s) } +/// Encodes a generated proto message for arbitrary ProtoFmt with provided serializer. pub(crate) fn encode_with_serializer( x: &T, mut serializer: Serializer, F>, diff --git a/node/tools/src/rpc/methods/config.rs b/node/tools/src/rpc/methods/config.rs index 0d22ec4d..f03e9353 100644 --- a/node/tools/src/rpc/methods/config.rs +++ b/node/tools/src/rpc/methods/config.rs @@ -12,6 +12,7 @@ pub(crate) struct ConfigInfo; // RPCMethod trait should be more general to allow external parameters like this case // TODO fix the trait and implement this code in it impl ConfigInfo { + /// Provide the node's config information pub(crate) fn info(config: AppConfig) -> Result { // This may change in the future since we are assuming that the executor binary is being run inside the config directory. Ok(serde_json::json!({ diff --git a/node/tools/src/tests.rs b/node/tools/src/tests.rs index aa4e8fbb..f758349c 100644 --- a/node/tools/src/tests.rs +++ b/node/tools/src/tests.rs @@ -23,10 +23,10 @@ impl Distribution for Standard { .with_gossip_dynamic_inbound_limit(rng.gen()) .with_gossip_dynamic_inbound_limit(rng.gen()) .with_max_payload_size(rng.gen()); - (0..5).into_iter().for_each(|_| { + (0..5).for_each(|_| { let _ = config.add_gossip_static_inbound(rng.gen::().public()); }); - (0..6).into_iter().for_each(|_| { + (0..6).for_each(|_| { let _ = config .add_gossip_static_outbound(rng.gen::().public(), make_addr(rng)); });