Skip to content

Commit 1200a39

Browse files
clippy warnings (sigp#136)
1 parent 878ef13 commit 1200a39

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

examples/simple_server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async fn main() {
4646
let mut builder = enr::EnrBuilder::new("v4");
4747
// if an IP was specified, use it
4848
if let Some(external_address) = address {
49-
builder.ip4(external_address.into());
49+
builder.ip4(external_address);
5050
}
5151
// if a port was specified, use it
5252
if std::env::args().nth(2).is_some() {

src/error.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl From<std::io::Error> for Discv5Error {
4747
}
4848
}
4949

50-
#[derive(Debug, Clone, PartialEq)]
50+
#[derive(Debug, Clone, PartialEq, Eq)]
5151
/// Types of packet errors.
5252
pub enum PacketError {
5353
/// The packet type is unknown.
@@ -70,7 +70,7 @@ pub enum PacketError {
7070
InvalidEnr(DecoderError),
7171
}
7272

73-
#[derive(Debug, Clone, PartialEq)]
73+
#[derive(Debug, Clone, PartialEq, Eq)]
7474
#[non_exhaustive]
7575
pub enum ResponseError {
7676
/// The channel used to send the response has already been closed.
@@ -89,7 +89,7 @@ impl fmt::Display for ResponseError {
8989

9090
impl std::error::Error for ResponseError {}
9191

92-
#[derive(Debug, Clone, PartialEq)]
92+
#[derive(Debug, Clone, PartialEq, Eq)]
9393
pub enum RequestError {
9494
/// The request timed out.
9595
Timeout,
@@ -113,7 +113,7 @@ pub enum RequestError {
113113
EntropyFailure(&'static str),
114114
}
115115

116-
#[derive(Debug, Clone, PartialEq)]
116+
#[derive(Debug, Clone, PartialEq, Eq)]
117117
pub enum QueryError {
118118
/// The discv5 service is not currently running.
119119
ServiceNotStarted,

src/handler/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub enum HandlerIn {
103103
}
104104

105105
/// Messages sent between a node on the network and `Handler`.
106-
#[derive(Debug, Clone, PartialEq)]
106+
#[derive(Debug, Clone, PartialEq, Eq)]
107107
pub enum HandlerOut {
108108
/// A session has been established with a node.
109109
///
@@ -139,7 +139,7 @@ pub enum ConnectionDirection {
139139

140140
/// A reference for the application layer to send back when the handler requests any known
141141
/// ENR for the NodeContact.
142-
#[derive(Debug, Clone, PartialEq)]
142+
#[derive(Debug, Clone, PartialEq, Eq)]
143143
pub struct WhoAreYouRef(pub NodeAddress, MessageNonce);
144144

145145
#[derive(Debug)]

src/ipmode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::net::SocketAddr;
55
/// Sets the socket type to be established and also determines the type of ENRs that we will store
66
/// in our routing table.
77
/// We store ENR's that have a `get_contractable_addr()` based on the `IpMode` set.
8-
#[derive(Debug, Clone, Copy, PartialEq)]
8+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
99
pub enum IpMode {
1010
/// IPv4 only. This creates an IPv4 only UDP socket and will only store ENRs in the local
1111
/// routing table if they contain a contactable IPv4 address.

src/packet/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl AsRef<[u8]> for ChallengeData {
7272
}
7373
}
7474

75-
#[derive(Debug, Clone, PartialEq)]
75+
#[derive(Debug, Clone, PartialEq, Eq)]
7676
pub struct Packet {
7777
/// Random data unique to the packet.
7878
pub iv: u128,
@@ -82,7 +82,7 @@ pub struct Packet {
8282
pub message: Vec<u8>,
8383
}
8484

85-
#[derive(Debug, Clone, PartialEq)]
85+
#[derive(Debug, Clone, PartialEq, Eq)]
8686
pub struct PacketHeader {
8787
/// The nonce of the associated message
8888
pub message_nonce: MessageNonce,
@@ -106,7 +106,7 @@ impl PacketHeader {
106106
}
107107
}
108108

109-
#[derive(Debug, Clone, PartialEq)]
109+
#[derive(Debug, Clone, PartialEq, Eq)]
110110
pub enum PacketKind {
111111
/// An ordinary message.
112112
Message {

src/rpc.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl RequestId {
3434
}
3535
}
3636

37-
#[derive(Debug, Clone, PartialEq)]
37+
#[derive(Debug, Clone, PartialEq, Eq)]
3838
/// A combined type representing requests and responses.
3939
pub enum Message {
4040
/// A request, which contains its [`RequestId`].
@@ -43,7 +43,7 @@ pub enum Message {
4343
Response(Response),
4444
}
4545

46-
#[derive(Debug, Clone, PartialEq)]
46+
#[derive(Debug, Clone, PartialEq, Eq)]
4747
/// A request sent between nodes.
4848
pub struct Request {
4949
/// The [`RequestId`] of the request.
@@ -52,7 +52,7 @@ pub struct Request {
5252
pub body: RequestBody,
5353
}
5454

55-
#[derive(Debug, Clone, PartialEq)]
55+
#[derive(Debug, Clone, PartialEq, Eq)]
5656
/// A response sent in response to a [`Request`]
5757
pub struct Response {
5858
/// The [`RequestId`] of the request that triggered this response.
@@ -61,7 +61,7 @@ pub struct Response {
6161
pub body: ResponseBody,
6262
}
6363

64-
#[derive(Debug, Clone, PartialEq)]
64+
#[derive(Debug, Clone, PartialEq, Eq)]
6565
pub enum RequestBody {
6666
/// A PING request.
6767
Ping {
@@ -90,7 +90,7 @@ pub enum RequestBody {
9090
TopicQuery { topic: TopicHash },
9191
}
9292

93-
#[derive(Debug, Clone, PartialEq)]
93+
#[derive(Debug, Clone, PartialEq, Eq)]
9494
pub enum ResponseBody {
9595
/// A PONG response.
9696
Pong {

0 commit comments

Comments
 (0)