mirror of
https://github.com/arampoire/onetun.git
synced 2025-12-01 00:00:24 -05:00
Cleanup usage of anyhow with_context
This commit is contained in:
parent
3ccd000ea8
commit
ce40f85efa
9 changed files with 55 additions and 69 deletions
|
|
@ -61,7 +61,7 @@ impl UdpVirtualInterface {
|
|||
IpAddress::from(port_forward.destination.ip()),
|
||||
port_forward.destination.port(),
|
||||
))
|
||||
.with_context(|| "UDP virtual server socket failed to bind")?;
|
||||
.context("UDP virtual server socket failed to bind")?;
|
||||
Ok(socket)
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ impl UdpVirtualInterface {
|
|||
let mut socket = udp::Socket::new(udp_rx_buffer, udp_tx_buffer);
|
||||
socket
|
||||
.bind((IpAddress::from(source_peer_ip), client_port.num()))
|
||||
.with_context(|| "UDP virtual client failed to bind")?;
|
||||
.context("UDP virtual client failed to bind")?;
|
||||
Ok(socket)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue