litep2p
litep2p copied to clipboard
clippy: Revisit allowed clippy rules
Revisit the allowed clippy rules introduced by: https://github.com/paritytech/litep2p/pull/83.
A few notes on them:
- single_match: Most of the code uses
match { Variant::A => ..., _ => ... } - result_large_err: We could reduce this to propagate the expected peer, this info is not used currently in substrate
https://github.com/paritytech/litep2p/blob/08112ca642cea3809625ae0abde05dc0dc46b4f3/src/error.rs#L115
- type_complexity: We have a few complex types to reason about futures
PeerIdMismatch(PeerId, PeerId) this one is used by https://github.com/dmitry-markin/p2p-probe to detect the correct PeerId.
Currently ignored clippy lints for context: https://github.com/paritytech/litep2p/blob/5c37774d0b377430bad408a6f7ed5e9f1ff53c7f/src/lib.rs#L21-L29