Skip to content

Commit

Permalink
Fix: Unused var in most features #224
Browse files Browse the repository at this point in the history
  • Loading branch information
cainthebest authored Sep 26, 2024
2 parents c82dc7d + 3964735 commit 480ff2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/lib/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub trait Socket {
///
/// # Returns
/// The local SocketAddr.
#[cfg(feature = "packet_capture")]
fn local_addr(&self) -> std::io::Result<SocketAddr>;
}

Expand Down Expand Up @@ -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() }
}

Expand Down Expand Up @@ -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() }
}

Expand Down

0 comments on commit 480ff2b

Please sign in to comment.