mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 08:11:39 +00:00
fix: deal with new lints from beta clippy (#3389)
Most of this is trivial, apart from the rename of the `clippy::derive_hash_xor_eq` lint to `clippy::derived_hash_with_manual_eq`. Instead of allowing that lint, we manually implement `PartialEq` and add a comment why the difference between the `PartialEq` and `Hash` implementations are okay.
This commit is contained in:
@ -636,20 +636,15 @@ pub enum NotifyHandler {
|
||||
}
|
||||
|
||||
/// The options which connections to close.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub enum CloseConnection {
|
||||
/// Disconnect a particular connection.
|
||||
One(ConnectionId),
|
||||
/// Disconnect all connections.
|
||||
#[default]
|
||||
All,
|
||||
}
|
||||
|
||||
impl Default for CloseConnection {
|
||||
fn default() -> Self {
|
||||
CloseConnection::All
|
||||
}
|
||||
}
|
||||
|
||||
/// Enumeration with the list of the possible events
|
||||
/// to pass to [`on_swarm_event`](NetworkBehaviour::on_swarm_event).
|
||||
pub enum FromSwarm<'a, Handler: IntoConnectionHandler> {
|
||||
|
@ -320,11 +320,12 @@ impl WithoutPeerIdWithAddress {
|
||||
/// .condition(PeerCondition::Disconnected)
|
||||
/// .build();
|
||||
/// ```
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Copy, Clone, Default)]
|
||||
pub enum PeerCondition {
|
||||
/// A new dialing attempt is initiated _only if_ the peer is currently
|
||||
/// considered disconnected, i.e. there is no established connection
|
||||
/// and no ongoing dialing attempt.
|
||||
#[default]
|
||||
Disconnected,
|
||||
/// A new dialing attempt is initiated _only if_ there is currently
|
||||
/// no ongoing dialing attempt, i.e. the peer is either considered
|
||||
@ -334,9 +335,3 @@ pub enum PeerCondition {
|
||||
/// configured connection limits.
|
||||
Always,
|
||||
}
|
||||
|
||||
impl Default for PeerCondition {
|
||||
fn default() -> Self {
|
||||
PeerCondition::Disconnected
|
||||
}
|
||||
}
|
||||
|
@ -1559,7 +1559,6 @@ where
|
||||
.new_handler()
|
||||
.inbound_protocol()
|
||||
.protocol_info()
|
||||
.into_iter()
|
||||
.map(|info| info.protocol_name().to_vec())
|
||||
.collect();
|
||||
|
||||
|
Reference in New Issue
Block a user