litep2p icon indicating copy to clipboard operation
litep2p copied to clipboard

clippy: Revisit allowed clippy rules

Open lexnv opened this issue 2 years ago • 2 comments

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

lexnv avatar Apr 24 '24 05:04 lexnv

PeerIdMismatch(PeerId, PeerId) this one is used by https://github.com/dmitry-markin/p2p-probe to detect the correct PeerId.

dmitry-markin avatar Apr 24 '24 07:04 dmitry-markin

Currently ignored clippy lints for context: https://github.com/paritytech/litep2p/blob/5c37774d0b377430bad408a6f7ed5e9f1ff53c7f/src/lib.rs#L21-L29

dmitry-markin avatar Apr 24 '24 07:04 dmitry-markin