mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 16:02:32 +00:00
fix: resolve compilation warnings on Rust 1.93+
- Replace deprecated `TcpStream::set_linger()` with `SockRef::from().set_linger()` (tokio deprecated the method as SO_LINGER can block the thread on drop) - Prefix unused parameter `gw` with underscore in `add_interface_ipv4_address()` (the gateway param is unused on Linux as `ip addr add` does not accept it)
This commit is contained in:
1 parent
5c33e7fd82
commit
742fa073cd
2 files changed
+2
-2
No files matched your search
@@ -113,7 +113,7 @@ pub fn get_default_interface() -> Result<String> {
|
||||
pub fn add_interface_ipv4_address(
|
||||
name: &str,
|
||||
addr: Ipv4Addr,
|
||||
gw: Ipv4Addr,
|
||||
_gw: Ipv4Addr,
|
||||
mask: Ipv4Addr,
|
||||
) -> Result<()> {
|
||||
Command::new("ip")
|
||||
|
||||
@@ -191,7 +191,7 @@ impl TcpListener {
|
||||
pub async fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> {
|
||||
let (stream, addr) = self.inner.accept().await?;
|
||||
apply_socket_opts(&stream)?;
|
||||
stream.set_linger(Some(Duration::ZERO))?;
|
||||
SockRef::from(&stream).set_linger(Some(Duration::ZERO))?;
|
||||
Ok((stream, addr))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user