From 67405c20940d8861f62362137a2f3515cba25067 Mon Sep 17 00:00:00 2001 From: Divma <26765164+divagant-martian@users.noreply.github.com> Date: Wed, 15 Mar 2023 19:24:05 -0500 Subject: [PATCH] update for new clippy lints (#168) * update for new clippy lints * fmt --- src/ipmode.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ipmode.rs b/src/ipmode.rs index 25f51757a..cf527d8fa 100644 --- a/src/ipmode.rs +++ b/src/ipmode.rs @@ -5,10 +5,11 @@ use std::net::SocketAddr; /// Sets the socket type to be established and also determines the type of ENRs that we will store /// in our routing table. /// We store ENR's that have a `get_contractable_addr()` based on the `IpMode` set. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub enum IpMode { /// IPv4 only. This creates an IPv4 only UDP socket and will only store ENRs in the local /// routing table if they contain a contactable IPv4 address. + #[default] Ip4, /// This enables IPv6 support. This creates an IPv6 socket. If `enable_mapped_addresses` is set /// to true, this creates a dual-stack socket capable of sending/receiving IPv4 and IPv6 @@ -17,12 +18,6 @@ pub enum IpMode { Ip6 { enable_mapped_addresses: bool }, } -impl Default for IpMode { - fn default() -> Self { - IpMode::Ip4 - } -} - impl IpMode { pub fn is_ipv4(&self) -> bool { self == &IpMode::Ip4