diff --git a/aquatic_udp/src/lib/common/mod.rs b/aquatic_udp/src/lib/common/mod.rs index 41c52e8..b0674ff 100644 --- a/aquatic_udp/src/lib/common/mod.rs +++ b/aquatic_udp/src/lib/common/mod.rs @@ -269,18 +269,6 @@ impl Default for State { } } } -pub fn ip_version_from_ip(ip: IpAddr) -> IpVersion { - match ip { - IpAddr::V4(_) => IpVersion::IPv4, - IpAddr::V6(ip) => { - if let [0, 0, 0, 0, 0, 0xffff, ..] = ip.segments() { - IpVersion::IPv4 - } else { - IpVersion::IPv6 - } - } - } -} #[cfg(test)] mod tests { diff --git a/aquatic_udp_protocol/src/common.rs b/aquatic_udp_protocol/src/common.rs index 6070e29..77192c6 100644 --- a/aquatic_udp_protocol/src/common.rs +++ b/aquatic_udp_protocol/src/common.rs @@ -1,11 +1,5 @@ use std::net::{Ipv4Addr, Ipv6Addr}; -#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)] -pub enum IpVersion { - IPv4, - IPv6, -} - #[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)] pub struct AnnounceInterval(pub i32); @@ -48,17 +42,6 @@ pub struct ResponsePeerIpv6 { pub port: Port, } -#[cfg(test)] -impl quickcheck::Arbitrary for IpVersion { - fn arbitrary(g: &mut quickcheck::Gen) -> Self { - if bool::arbitrary(g) { - IpVersion::IPv4 - } else { - IpVersion::IPv6 - } - } -} - #[cfg(test)] impl quickcheck::Arbitrary for InfoHash { fn arbitrary(g: &mut quickcheck::Gen) -> Self {