Fix: Unused var in most features #224

This commit is contained in:
Cain 2024-09-26 23:43:12 +01:00 committed by GitHub
commit 480ff2b531
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,6 +61,7 @@ pub trait Socket {
///
/// # Returns
/// The local SocketAddr.
#[cfg(feature = "packet_capture")]
fn local_addr(&self) -> std::io::Result<SocketAddr>;
}
@ -112,6 +113,8 @@ impl Socket for TcpSocketImpl {
}
fn port(&self) -> u16 { self.address.port() }
#[cfg(feature = "packet_capture")]
fn local_addr(&self) -> std::io::Result<SocketAddr> { self.socket.local_addr() }
}
@ -164,6 +167,8 @@ impl Socket for UdpSocketImpl {
}
fn port(&self) -> u16 { self.address.port() }
#[cfg(feature = "packet_capture")]
fn local_addr(&self) -> std::io::Result<SocketAddr> { self.socket.local_addr() }
}