Skip to content

network-libp2p: Expose a configuration for the desired number of peers

Sign in for the full log view
GitHub Actions / Clippy Report succeeded Dec 19, 2023 in 1s

Clippy Report

1 warning

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 1
Note 0
Help 0

Versions

  • rustc 1.74.1 (a28077b28 2023-12-04)
  • cargo 1.74.1 (ecb9851af 2023-10-18)
  • clippy 0.1.74 (a28077b 2023-12-04)

Annotations

Check warning on line 321 in network-libp2p/src/connection_pool/behaviour.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Report

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default()
   --> network-libp2p/src/connection_pool/behaviour.rs:321:9
    |
321 |         config.peer_count_desired = peer_count_desired;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `connection_pool::behaviour::Config { peer_count_desired: peer_count_desired, ..Default::default() }` and removing relevant reassignments
   --> network-libp2p/src/connection_pool/behaviour.rs:320:9
    |
320 |         let mut config = Config::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
    = note: `#[warn(clippy::field_reassign_with_default)]` on by default