Skip to content

Commit 67405c2

Browse files
update for new clippy lints (#168)
* update for new clippy lints * fmt
1 parent 7b71237 commit 67405c2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/ipmode.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ 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, Eq)]
8+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
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.
12+
#[default]
1213
Ip4,
1314
/// This enables IPv6 support. This creates an IPv6 socket. If `enable_mapped_addresses` is set
1415
/// to true, this creates a dual-stack socket capable of sending/receiving IPv4 and IPv6
@@ -17,12 +18,6 @@ pub enum IpMode {
1718
Ip6 { enable_mapped_addresses: bool },
1819
}
1920

20-
impl Default for IpMode {
21-
fn default() -> Self {
22-
IpMode::Ip4
23-
}
24-
}
25-
2621
impl IpMode {
2722
pub fn is_ipv4(&self) -> bool {
2823
self == &IpMode::Ip4

0 commit comments

Comments
 (0)