mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-18 12:31:22 +00:00
*: Fix clippy::derive-partial-eq-without-eq
(#2818)
This commit is contained in:
@ -38,6 +38,7 @@
|
|||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
extern crate _serde as serde;
|
extern crate _serde as serde;
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod keys_proto {
|
mod keys_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/keys_proto.rs"));
|
include!(concat!(env!("OUT_DIR"), "/keys_proto.rs"));
|
||||||
}
|
}
|
||||||
@ -46,6 +47,7 @@ mod envelope_proto {
|
|||||||
include!(concat!(env!("OUT_DIR"), "/envelope_proto.rs"));
|
include!(concat!(env!("OUT_DIR"), "/envelope_proto.rs"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod peer_record_proto {
|
mod peer_record_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/peer_record_proto.rs"));
|
include!(concat!(env!("OUT_DIR"), "/peer_record_proto.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.
|
/// 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>
|
/// 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 {
|
pub struct PeerRecord {
|
||||||
peer_id: PeerId,
|
peer_id: PeerId,
|
||||||
seq: u64,
|
seq: u64,
|
||||||
|
@ -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.
|
/// 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>
|
/// 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 {
|
pub struct SignedEnvelope {
|
||||||
key: PublicKey,
|
key: PublicKey,
|
||||||
payload_type: Vec<u8>,
|
payload_type: Vec<u8>,
|
||||||
|
@ -130,7 +130,7 @@ impl ProbeId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Event produced by [`Behaviour`].
|
/// Event produced by [`Behaviour`].
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
/// Event on an inbound probe.
|
/// Event on an inbound probe.
|
||||||
InboundProbe(InboundProbeEvent),
|
InboundProbe(InboundProbeEvent),
|
||||||
|
@ -40,7 +40,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Outbound probe failed or was aborted.
|
/// Outbound probe failed or was aborted.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum OutboundProbeError {
|
pub enum OutboundProbeError {
|
||||||
/// Probe was aborted because no server is known, or all servers
|
/// Probe was aborted because no server is known, or all servers
|
||||||
/// are throttled through [`Config::throttle_server_period`].
|
/// are throttled through [`Config::throttle_server_period`].
|
||||||
@ -54,7 +54,7 @@ pub enum OutboundProbeError {
|
|||||||
Response(ResponseError),
|
Response(ResponseError),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum OutboundProbeEvent {
|
pub enum OutboundProbeEvent {
|
||||||
/// A dial-back request was sent to a remote peer.
|
/// A dial-back request was sent to a remote peer.
|
||||||
Request {
|
Request {
|
||||||
|
@ -38,7 +38,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Inbound probe failed.
|
/// Inbound probe failed.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum InboundProbeError {
|
pub enum InboundProbeError {
|
||||||
/// Receiving the dial-back request or sending a response failed.
|
/// Receiving the dial-back request or sending a response failed.
|
||||||
InboundRequest(InboundFailure),
|
InboundRequest(InboundFailure),
|
||||||
@ -46,7 +46,7 @@ pub enum InboundProbeError {
|
|||||||
Response(ResponseError),
|
Response(ResponseError),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum InboundProbeEvent {
|
pub enum InboundProbeEvent {
|
||||||
/// A dial-back request was received from a remote peer.
|
/// A dial-back request was received from a remote peer.
|
||||||
Request {
|
Request {
|
||||||
|
@ -31,6 +31,7 @@ pub use self::{
|
|||||||
};
|
};
|
||||||
pub use libp2p_request_response::{InboundFailure, OutboundFailure};
|
pub use libp2p_request_response::{InboundFailure, OutboundFailure};
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod structs_proto {
|
mod structs_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/structs.rs"));
|
include!(concat!(env!("OUT_DIR"), "/structs.rs"));
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ pub use protocol::{
|
|||||||
PROTOCOL_NAME,
|
PROTOCOL_NAME,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod message_proto {
|
mod message_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/holepunch.pb.rs"));
|
include!(concat!(env!("OUT_DIR"), "/holepunch.pb.rs"));
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ pub mod protocol;
|
|||||||
mod layer;
|
mod layer;
|
||||||
mod topic;
|
mod topic;
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod rpc_proto {
|
mod rpc_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/floodsub.pb.rs"));
|
include!(concat!(env!("OUT_DIR"), "/floodsub.pb.rs"));
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ pub enum ValidationMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Selector for custom Protocol Id
|
/// Selector for custom Protocol Id
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum GossipsubVersion {
|
pub enum GossipsubVersion {
|
||||||
V1_0,
|
V1_0,
|
||||||
V1_1,
|
V1_1,
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// 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
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
#![allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/gossipsub.pb.rs"));
|
include!(concat!(env!("OUT_DIR"), "/gossipsub.pb.rs"));
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ declare_message_id_type!(MessageId, "MessageId");
|
|||||||
// filter duplicates quickly without performing the overhead of decompression.
|
// filter duplicates quickly without performing the overhead of decompression.
|
||||||
declare_message_id_type!(FastMessageId, "FastMessageId");
|
declare_message_id_type!(FastMessageId, "FastMessageId");
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct PeerConnections {
|
pub struct PeerConnections {
|
||||||
/// The kind of protocol the peer supports.
|
/// The kind of protocol the peer supports.
|
||||||
pub kind: PeerKind,
|
pub kind: PeerKind,
|
||||||
|
@ -51,6 +51,7 @@ mod handler;
|
|||||||
mod identify;
|
mod identify;
|
||||||
mod protocol;
|
mod protocol;
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod structs_proto {
|
mod structs_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/structs.rs"));
|
include!(concat!(env!("OUT_DIR"), "/structs.rs"));
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ mod behaviour;
|
|||||||
mod jobs;
|
mod jobs;
|
||||||
mod query;
|
mod query;
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod dht_proto {
|
mod dht_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/dht.pb.rs"));
|
include!(concat!(env!("OUT_DIR"), "/dht.pb.rs"));
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
//! Implementation of the [libp2p circuit relay v2
|
//! Implementation of the [libp2p circuit relay v2
|
||||||
//! specification](https://github.com/libp2p/specs/issues/314).
|
//! specification](https://github.com/libp2p/specs/issues/314).
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod message_proto {
|
mod message_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/message_v2.pb.rs"));
|
include!(concat!(env!("OUT_DIR"), "/message_v2.pb.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;
|
const MAX_MESSAGE_SIZE: usize = 4096;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub struct Limit {
|
pub struct Limit {
|
||||||
duration: Option<Duration>,
|
duration: Option<Duration>,
|
||||||
data_in_bytes: Option<u64>,
|
data_in_bytes: Option<u64>,
|
||||||
|
@ -182,7 +182,7 @@ impl NewRegistration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct Registration {
|
pub struct Registration {
|
||||||
pub namespace: Namespace,
|
pub namespace: Namespace,
|
||||||
pub record: PeerRecord,
|
pub record: PeerRecord,
|
||||||
@ -594,6 +594,7 @@ impl From<UnmappableStatusCode> for ConversionError {
|
|||||||
#[error("The response code ({0:?}) cannot be mapped to our ErrorCode enum")]
|
#[error("The response code ({0:?}) cannot be mapped to our ErrorCode enum")]
|
||||||
pub struct UnmappableStatusCode(wire::message::ResponseStatus);
|
pub struct UnmappableStatusCode(wire::message::ResponseStatus);
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod wire {
|
mod wire {
|
||||||
include!(concat!(env!("OUT_DIR"), "/rendezvous.pb.rs"));
|
include!(concat!(env!("OUT_DIR"), "/rendezvous.pb.rs"));
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ pub enum RequestResponseEvent<TRequest, TResponse, TChannelResponse = TResponse>
|
|||||||
|
|
||||||
/// Possible failures occurring in the context of sending
|
/// Possible failures occurring in the context of sending
|
||||||
/// an outbound request and receiving the response.
|
/// an outbound request and receiving the response.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum OutboundFailure {
|
pub enum OutboundFailure {
|
||||||
/// The request could not be sent because a dialing attempt failed.
|
/// The request could not be sent because a dialing attempt failed.
|
||||||
DialFailure,
|
DialFailure,
|
||||||
@ -184,7 +184,7 @@ impl std::error::Error for OutboundFailure {}
|
|||||||
|
|
||||||
/// Possible failures occurring in the context of receiving an
|
/// Possible failures occurring in the context of receiving an
|
||||||
/// inbound request and sending a response.
|
/// inbound request and sending a response.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum InboundFailure {
|
pub enum InboundFailure {
|
||||||
/// The inbound request timed out, either while reading the
|
/// The inbound request timed out, either while reading the
|
||||||
/// incoming request or before a response is sent, e.g. if
|
/// incoming request or before a response is sent, e.g. if
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
//! Noise protocol handshake I/O.
|
//! Noise protocol handshake I/O.
|
||||||
|
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod payload_proto {
|
mod payload_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/payload.proto.rs"));
|
include!(concat!(env!("OUT_DIR"), "/payload.proto.rs"));
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ use void::Void;
|
|||||||
|
|
||||||
mod error;
|
mod error;
|
||||||
mod handshake;
|
mod handshake;
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
mod structs_proto {
|
mod structs_proto {
|
||||||
include!(concat!(env!("OUT_DIR"), "/structs.rs"));
|
include!(concat!(env!("OUT_DIR"), "/structs.rs"));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user