diff options
author | Eduardo Broto <ebroto@tutanota.com> | 2019-12-07 21:24:57 +0100 |
---|---|---|
committer | Eduardo Broto <ebroto@tutanota.com> | 2019-12-07 22:38:01 +0100 |
commit | 9e6f390c1f34de0d0b413f4704fc2d1f655c47bc (patch) | |
tree | 089b711721a9c4aac2e461a2fa7211d7ba5de266 /src/network | |
parent | 423c6a52ba84c27b8667a762ee33bc28f44f0e37 (diff) |
chore(style): fix clippy errors
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/connection.rs | 4 | ||||
-rw-r--r-- | src/network/sniffer.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/network/connection.rs b/src/network/connection.rs index 75edf86..f931d54 100644 --- a/src/network/connection.rs +++ b/src/network/connection.rs @@ -11,8 +11,8 @@ pub enum Protocol { } impl Protocol { - pub fn from_string(string: &String) -> Option<Self> { - match string.as_str() { + pub fn from_str(string: &str) -> Option<Self> { + match string { "TCP" => Some(Protocol::Tcp), "UDP" => Some(Protocol::Udp), _ => None, diff --git a/src/network/sniffer.rs b/src/network/sniffer.rs index 0d68a20..3ec6886 100644 --- a/src/network/sniffer.rs +++ b/src/network/sniffer.rs @@ -26,7 +26,7 @@ pub enum Direction { } impl Direction { - pub fn new(network_interface_ips: &Vec<IpNetwork>, ip_packet: &Ipv4Packet) -> Self { + pub fn new(network_interface_ips: &[IpNetwork], ip_packet: &Ipv4Packet) -> Self { if network_interface_ips .iter() .any(|ip_network| ip_network.ip() == ip_packet.get_source()) |