*: Fix clippy::derive-partial-eq-without-eq (#2818)

This commit is contained in:
Elena Frank
2022-08-14 04:03:04 +02:00
committed by GitHub
parent 0a01c81c7b
commit 06aaea67f3
20 changed files with 25 additions and 13 deletions

View File

@ -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"));
}

View File

@ -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: <https://github.com/libp2p/specs/blob/master/RFC/0003-routing-records.md>
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct PeerRecord {
peer_id: PeerId,
seq: u64,

View File

@ -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: <https://github.com/libp2p/specs/blob/master/RFC/0002-signed-envelopes.md>
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SignedEnvelope {
key: PublicKey,
payload_type: Vec<u8>,

View File

@ -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),

View File

@ -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 {

View File

@ -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 {

View File

@ -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"));
}

View File

@ -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"));
}

View File

@ -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"));
}

View File

@ -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,

View File

@ -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"));

View File

@ -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,

View File

@ -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"));
}

View File

@ -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"));
}

View File

@ -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"));
}

View File

@ -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<Duration>,
data_in_bytes: Option<u64>,

View File

@ -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<UnmappableStatusCode> 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"));
}

View File

@ -147,7 +147,7 @@ pub enum RequestResponseEvent<TRequest, TResponse, TChannelResponse = TResponse>
/// 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

View File

@ -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"));
}

View File

@ -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"));
}