Skip to content

Commit

Permalink
Fixed clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ElFantasma committed Feb 19, 2024
1 parent c62f0b4 commit 2e89af8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions node/tools/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub(crate) fn encode_json<T: serde::ser::Serialize>(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<T: serde::ser::Serialize, F: Formatter>(
x: &T,
mut serializer: Serializer<Vec<u8>, F>,
Expand Down
1 change: 1 addition & 0 deletions node/tools/src/rpc/methods/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<serde_json::Value, ErrorCode> {
// 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!({
Expand Down
4 changes: 2 additions & 2 deletions node/tools/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ impl Distribution<AppConfig> 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::<node::SecretKey>().public());
});
(0..6).into_iter().for_each(|_| {
(0..6).for_each(|_| {
let _ = config
.add_gossip_static_outbound(rng.gen::<node::SecretKey>().public(), make_addr(rng));
});
Expand Down

0 comments on commit 2e89af8

Please sign in to comment.