diff --git a/core/src/lib.rs b/core/src/lib.rs index 315e20bc..fc5b6c24 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -38,6 +38,7 @@ #[cfg(feature = "serde")] extern crate _serde as serde; +#[allow(clippy::derive_partial_eq_without_eq)] mod keys_proto { include!(concat!(env!("OUT_DIR"), "/keys_proto.rs")); } @@ -46,6 +47,7 @@ mod envelope_proto { include!(concat!(env!("OUT_DIR"), "/envelope_proto.rs")); } +#[allow(clippy::derive_partial_eq_without_eq)] mod peer_record_proto { include!(concat!(env!("OUT_DIR"), "/peer_record_proto.rs")); } diff --git a/core/src/peer_record.rs b/core/src/peer_record.rs index f86df68f..d0d8e21a 100644 --- a/core/src/peer_record.rs +++ b/core/src/peer_record.rs @@ -13,7 +13,7 @@ const DOMAIN_SEP: &str = "libp2p-routing-state"; /// /// Peer records are designed to be distributable and carry a signature by being wrapped in a signed envelope. /// For more information see RFC0003 of the libp2p specifications: -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub struct PeerRecord { peer_id: PeerId, seq: u64, diff --git a/core/src/signed_envelope.rs b/core/src/signed_envelope.rs index 94e94316..33bfdf2d 100644 --- a/core/src/signed_envelope.rs +++ b/core/src/signed_envelope.rs @@ -8,7 +8,7 @@ use unsigned_varint::encode::usize_buffer; /// A signed envelope contains an arbitrary byte string payload, a signature of the payload, and the public key that can be used to verify the signature. /// /// For more details see libp2p RFC0002: -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct SignedEnvelope { key: PublicKey, payload_type: Vec, diff --git a/protocols/autonat/src/behaviour.rs b/protocols/autonat/src/behaviour.rs index f98bf5af..b39a7b14 100644 --- a/protocols/autonat/src/behaviour.rs +++ b/protocols/autonat/src/behaviour.rs @@ -130,7 +130,7 @@ impl ProbeId { } /// Event produced by [`Behaviour`]. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Event { /// Event on an inbound probe. InboundProbe(InboundProbeEvent), diff --git a/protocols/autonat/src/behaviour/as_client.rs b/protocols/autonat/src/behaviour/as_client.rs index 8d0097de..5a5e18b6 100644 --- a/protocols/autonat/src/behaviour/as_client.rs +++ b/protocols/autonat/src/behaviour/as_client.rs @@ -40,7 +40,7 @@ use std::{ }; /// Outbound probe failed or was aborted. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum OutboundProbeError { /// Probe was aborted because no server is known, or all servers /// are throttled through [`Config::throttle_server_period`]. @@ -54,7 +54,7 @@ pub enum OutboundProbeError { Response(ResponseError), } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum OutboundProbeEvent { /// A dial-back request was sent to a remote peer. Request { diff --git a/protocols/autonat/src/behaviour/as_server.rs b/protocols/autonat/src/behaviour/as_server.rs index 9b045c02..681076b9 100644 --- a/protocols/autonat/src/behaviour/as_server.rs +++ b/protocols/autonat/src/behaviour/as_server.rs @@ -38,7 +38,7 @@ use std::{ }; /// Inbound probe failed. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum InboundProbeError { /// Receiving the dial-back request or sending a response failed. InboundRequest(InboundFailure), @@ -46,7 +46,7 @@ pub enum InboundProbeError { Response(ResponseError), } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum InboundProbeEvent { /// A dial-back request was received from a remote peer. Request { diff --git a/protocols/autonat/src/lib.rs b/protocols/autonat/src/lib.rs index 3a1bf63c..b21c73dd 100644 --- a/protocols/autonat/src/lib.rs +++ b/protocols/autonat/src/lib.rs @@ -31,6 +31,7 @@ pub use self::{ }; pub use libp2p_request_response::{InboundFailure, OutboundFailure}; +#[allow(clippy::derive_partial_eq_without_eq)] mod structs_proto { include!(concat!(env!("OUT_DIR"), "/structs.rs")); } diff --git a/protocols/dcutr/src/lib.rs b/protocols/dcutr/src/lib.rs index c55f2242..4a843bac 100644 --- a/protocols/dcutr/src/lib.rs +++ b/protocols/dcutr/src/lib.rs @@ -30,6 +30,7 @@ pub use protocol::{ PROTOCOL_NAME, }; +#[allow(clippy::derive_partial_eq_without_eq)] mod message_proto { include!(concat!(env!("OUT_DIR"), "/holepunch.pb.rs")); } diff --git a/protocols/floodsub/src/lib.rs b/protocols/floodsub/src/lib.rs index 16f0df61..109d0db8 100644 --- a/protocols/floodsub/src/lib.rs +++ b/protocols/floodsub/src/lib.rs @@ -28,6 +28,7 @@ pub mod protocol; mod layer; mod topic; +#[allow(clippy::derive_partial_eq_without_eq)] mod rpc_proto { include!(concat!(env!("OUT_DIR"), "/floodsub.pb.rs")); } diff --git a/protocols/gossipsub/src/config.rs b/protocols/gossipsub/src/config.rs index 93939757..a0a8d5e4 100644 --- a/protocols/gossipsub/src/config.rs +++ b/protocols/gossipsub/src/config.rs @@ -50,7 +50,7 @@ pub enum ValidationMode { } /// Selector for custom Protocol Id -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum GossipsubVersion { V1_0, V1_1, diff --git a/protocols/gossipsub/src/rpc_proto.rs b/protocols/gossipsub/src/rpc_proto.rs index b9fa8106..3903318f 100644 --- a/protocols/gossipsub/src/rpc_proto.rs +++ b/protocols/gossipsub/src/rpc_proto.rs @@ -17,6 +17,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#![allow(clippy::derive_partial_eq_without_eq)] include!(concat!(env!("OUT_DIR"), "/gossipsub.pb.rs")); diff --git a/protocols/gossipsub/src/types.rs b/protocols/gossipsub/src/types.rs index 6ffde514..29c72d1f 100644 --- a/protocols/gossipsub/src/types.rs +++ b/protocols/gossipsub/src/types.rs @@ -86,7 +86,7 @@ declare_message_id_type!(MessageId, "MessageId"); // filter duplicates quickly without performing the overhead of decompression. declare_message_id_type!(FastMessageId, "FastMessageId"); -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct PeerConnections { /// The kind of protocol the peer supports. pub kind: PeerKind, diff --git a/protocols/identify/src/lib.rs b/protocols/identify/src/lib.rs index 17925fb6..2f73a5a0 100644 --- a/protocols/identify/src/lib.rs +++ b/protocols/identify/src/lib.rs @@ -51,6 +51,7 @@ mod handler; mod identify; mod protocol; +#[allow(clippy::derive_partial_eq_without_eq)] mod structs_proto { include!(concat!(env!("OUT_DIR"), "/structs.rs")); } diff --git a/protocols/kad/src/lib.rs b/protocols/kad/src/lib.rs index e46e2b16..8c000a00 100644 --- a/protocols/kad/src/lib.rs +++ b/protocols/kad/src/lib.rs @@ -52,6 +52,7 @@ mod behaviour; mod jobs; mod query; +#[allow(clippy::derive_partial_eq_without_eq)] mod dht_proto { include!(concat!(env!("OUT_DIR"), "/dht.pb.rs")); } diff --git a/protocols/relay/src/v2.rs b/protocols/relay/src/v2.rs index c610c1a3..dcfcdf60 100644 --- a/protocols/relay/src/v2.rs +++ b/protocols/relay/src/v2.rs @@ -21,6 +21,7 @@ //! Implementation of the [libp2p circuit relay v2 //! specification](https://github.com/libp2p/specs/issues/314). +#[allow(clippy::derive_partial_eq_without_eq)] mod message_proto { include!(concat!(env!("OUT_DIR"), "/message_v2.pb.rs")); } diff --git a/protocols/relay/src/v2/protocol.rs b/protocols/relay/src/v2/protocol.rs index 27f69994..6e9ccc14 100644 --- a/protocols/relay/src/v2/protocol.rs +++ b/protocols/relay/src/v2/protocol.rs @@ -31,7 +31,7 @@ pub const STOP_PROTOCOL_NAME: &[u8; 32] = b"/libp2p/circuit/relay/0.2.0/stop"; const MAX_MESSAGE_SIZE: usize = 4096; -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Limit { duration: Option, data_in_bytes: Option, diff --git a/protocols/rendezvous/src/codec.rs b/protocols/rendezvous/src/codec.rs index 3798cea7..375ebd6c 100644 --- a/protocols/rendezvous/src/codec.rs +++ b/protocols/rendezvous/src/codec.rs @@ -182,7 +182,7 @@ impl NewRegistration { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Registration { pub namespace: Namespace, pub record: PeerRecord, @@ -594,6 +594,7 @@ impl From for ConversionError { #[error("The response code ({0:?}) cannot be mapped to our ErrorCode enum")] pub struct UnmappableStatusCode(wire::message::ResponseStatus); +#[allow(clippy::derive_partial_eq_without_eq)] mod wire { include!(concat!(env!("OUT_DIR"), "/rendezvous.pb.rs")); } diff --git a/protocols/request-response/src/lib.rs b/protocols/request-response/src/lib.rs index ea334292..c4e18d89 100644 --- a/protocols/request-response/src/lib.rs +++ b/protocols/request-response/src/lib.rs @@ -147,7 +147,7 @@ pub enum RequestResponseEvent /// Possible failures occurring in the context of sending /// an outbound request and receiving the response. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum OutboundFailure { /// The request could not be sent because a dialing attempt failed. DialFailure, @@ -184,7 +184,7 @@ impl std::error::Error for OutboundFailure {} /// Possible failures occurring in the context of receiving an /// inbound request and sending a response. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum InboundFailure { /// The inbound request timed out, either while reading the /// incoming request or before a response is sent, e.g. if diff --git a/transports/noise/src/io/handshake.rs b/transports/noise/src/io/handshake.rs index fa97798f..35099ea8 100644 --- a/transports/noise/src/io/handshake.rs +++ b/transports/noise/src/io/handshake.rs @@ -20,6 +20,7 @@ //! Noise protocol handshake I/O. +#[allow(clippy::derive_partial_eq_without_eq)] mod payload_proto { include!(concat!(env!("OUT_DIR"), "/payload.proto.rs")); } diff --git a/transports/plaintext/src/lib.rs b/transports/plaintext/src/lib.rs index 1e9cfecf..9855a329 100644 --- a/transports/plaintext/src/lib.rs +++ b/transports/plaintext/src/lib.rs @@ -35,6 +35,7 @@ use void::Void; mod error; mod handshake; +#[allow(clippy::derive_partial_eq_without_eq)] mod structs_proto { include!(concat!(env!("OUT_DIR"), "/structs.rs")); }