Skip to content

Commit

Permalink
update for new clippy lints (#168)
Browse files Browse the repository at this point in the history
* update for new clippy lints

* fmt
  • Loading branch information
divagant-martian authored Mar 16, 2023
1 parent 7b71237 commit 67405c2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/ipmode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 67405c2

Please sign in to comment.