Skip to content

Add ValidatorInfo to the PeerContacts. Do basic verification

Sign in for the full log view
GitHub Actions / Clippy Report succeeded Nov 12, 2024 in 1s

Clippy Report

2 warnings

Details

Results

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

Versions

  • rustc 1.82.0 (f6e511eec 2024-10-15)
  • cargo 1.82.0 (8f40fc59f 2024-08-21)
  • clippy 0.1.82 (f6e511e 2024-10-15)

Annotations

Check warning on line 116 in dht/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Report

using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`

warning: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`
   --> dht/src/lib.rs:108:17
    |
108 | /                 self.verify_validator_record(&validator_record)
109 | |                     .map_err(DhtVerifierError::ValidatorInfoError)
110 | |                     .and_then(|_| {
111 | |                         Ok(DhtRecord::Validator(
...   |
115 | |                         ))
116 | |                     })
    | |______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
    = note: `#[warn(clippy::bind_instead_of_map)]` on by default
help: try
    |
108 ~                 self.verify_validator_record(&validator_record)
109 +                     .map_err(DhtVerifierError::ValidatorInfoError).map(|_| DhtRecord::Validator(
110 +                             validator_record.record.peer_id,
111 +                             validator_record.record,
112 +                             record.clone(),
113 +                         ))
    |

Check warning on line 62 in dht/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Report

unnecessary closure used with `bool::then`

warning: unnecessary closure used with `bool::then`
  --> dht/src/lib.rs:60:9
   |
60 | /         signed_record
61 | |             .verify(&public_key)
62 | |             .then(|| ())
   | |________________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
   = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
help: use `then_some` instead
   |
62 |             .then_some(())
   |              ~~~~~~~~~~~~~