mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
Fix: Unused var in most features #224
This commit is contained in:
commit
480ff2b531
1 changed files with 5 additions and 0 deletions
|
|
@ -61,6 +61,7 @@ pub trait Socket {
|
||||||
///
|
///
|
||||||
/// # Returns
|
/// # Returns
|
||||||
/// The local SocketAddr.
|
/// The local SocketAddr.
|
||||||
|
#[cfg(feature = "packet_capture")]
|
||||||
fn local_addr(&self) -> std::io::Result<SocketAddr>;
|
fn local_addr(&self) -> std::io::Result<SocketAddr>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,6 +113,8 @@ impl Socket for TcpSocketImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn port(&self) -> u16 { self.address.port() }
|
fn port(&self) -> u16 { self.address.port() }
|
||||||
|
|
||||||
|
#[cfg(feature = "packet_capture")]
|
||||||
fn local_addr(&self) -> std::io::Result<SocketAddr> { self.socket.local_addr() }
|
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() }
|
fn port(&self) -> u16 { self.address.port() }
|
||||||
|
|
||||||
|
#[cfg(feature = "packet_capture")]
|
||||||
fn local_addr(&self) -> std::io::Result<SocketAddr> { self.socket.local_addr() }
|
fn local_addr(&self) -> std::io::Result<SocketAddr> { self.socket.local_addr() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue