diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-07-17 23:41:42 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-07-19 09:18:58 +0200 |
| commit | 314538dc3dbe46f01bb4b4c7d0fc0d69f1365008 (patch) | |
| tree | 559c67da62206334a38facb31707b8c395bda6bf | |
| parent | ec6248d4a431c91c6a437e5a4897911d4701347b (diff) | |
| download | mullvadvpn-314538dc3dbe46f01bb4b4c7d0fc0d69f1365008.tar.xz mullvadvpn-314538dc3dbe46f01bb4b4c7d0fc0d69f1365008.zip | |
Fix clippy warnings in talpid-types
| -rw-r--r-- | talpid-types/src/net.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/talpid-types/src/net.rs b/talpid-types/src/net.rs index fff70094d0..53a2b30ab5 100644 --- a/talpid-types/src/net.rs +++ b/talpid-types/src/net.rs @@ -34,15 +34,15 @@ pub enum TunnelEndpointData { } impl TunnelEndpointData { - pub fn port(&self) -> u16 { - match *self { + pub fn port(self) -> u16 { + match self { TunnelEndpointData::OpenVpn(metadata) => metadata.port, TunnelEndpointData::Wireguard(metadata) => metadata.port, } } - pub fn transport_protocol(&self) -> TransportProtocol { - match *self { + pub fn transport_protocol(self) -> TransportProtocol { + match self { TunnelEndpointData::OpenVpn(metadata) => metadata.protocol, TunnelEndpointData::Wireguard(_) => TransportProtocol::Udp, } @@ -72,10 +72,10 @@ pub struct Endpoint { impl Endpoint { /// Constructs a new `Endpoint` from the given parameters. - pub fn new<T: Into<IpAddr>>(address: T, port: u16, protocol: TransportProtocol) -> Self { + pub fn new(address: impl Into<IpAddr>, port: u16, protocol: TransportProtocol) -> Self { Endpoint { address: SocketAddr::new(address.into(), port), - protocol: protocol, + protocol, } } } |
