Skip to content

Commit

Permalink
*: Fix clippy::derive-partial-eq-without-eq (#2818)
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaf9 authored Aug 14, 2022
1 parent 0a01c81 commit 06aaea6
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 13 deletions.
2 changes: 2 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand All @@ -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"));
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/peer_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion core/src/signed_envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
2 changes: 1 addition & 1 deletion protocols/autonat/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions protocols/autonat/src/behaviour/as_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`].
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions protocols/autonat/src/behaviour/as_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ 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),
/// We refused or failed to dial the client.
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 {
Expand Down
1 change: 1 addition & 0 deletions protocols/autonat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
1 change: 1 addition & 0 deletions protocols/dcutr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
1 change: 1 addition & 0 deletions protocols/floodsub/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions protocols/gossipsub/src/rpc_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions protocols/identify/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
1 change: 1 addition & 0 deletions protocols/kad/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
1 change: 1 addition & 0 deletions protocols/relay/src/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
2 changes: 1 addition & 1 deletion protocols/relay/src/v2/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
3 changes: 2 additions & 1 deletion protocols/rendezvous/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl NewRegistration {
}
}

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Registration {
pub namespace: Namespace,
pub record: PeerRecord,
Expand Down Expand Up @@ -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"));
}
Expand Down
4 changes: 2 additions & 2 deletions protocols/request-response/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions transports/noise/src/io/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
1 change: 1 addition & 0 deletions transports/plaintext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down

0 comments on commit 06aaea6

Please sign in to comment.