mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-22 14:59:09 +00:00
Update tun2proxy.rs
This commit is contained in:
parent
2540daa423
commit
d5fdf845bf
1 changed files with 7 additions and 9 deletions
|
@ -48,15 +48,13 @@ pub(crate) struct Destination {
|
|||
impl TryFrom<Destination> for SocketAddr {
|
||||
type Error = Error;
|
||||
fn try_from(value: Destination) -> Result<Self, Self::Error> {
|
||||
Ok(SocketAddr::new(
|
||||
match value.host {
|
||||
DestinationHost::Address(addr) => addr,
|
||||
Hostname(e) => {
|
||||
return Err(e.into());
|
||||
}
|
||||
},
|
||||
value.port,
|
||||
))
|
||||
let ip = match value.host {
|
||||
DestinationHost::Address(addr) => addr,
|
||||
Hostname(e) => {
|
||||
return Err(e.into());
|
||||
}
|
||||
};
|
||||
Ok(SocketAddr::new(ip, value.port))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue