diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2020-01-09 01:10:21 +0100 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2020-01-09 01:10:41 +0100 |
commit | 9cae8da50be0cf0e2fe049f37117c4250d502db4 (patch) | |
tree | 8ea00a117e5a16b78f8ba7f2364084d0d424931f /src | |
parent | 10e23776e95724cee77b367bdaaf111df8c1be51 (diff) |
Fix codestyle using rustfmt
Diffstat (limited to 'src')
-rw-r--r-- | src/network/sniffer.rs | 8 | ||||
-rw-r--r-- | src/tests/cases/raw_mode.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/network/sniffer.rs b/src/network/sniffer.rs index fccf0b9..ae73714 100644 --- a/src/network/sniffer.rs +++ b/src/network/sniffer.rs @@ -65,7 +65,9 @@ impl Sniffer { _ => { let pkg = EthernetPacket::new(bytes)?; match pkg.get_ethertype() { - EtherTypes::Ipv4 => Self::handle_v4(Ipv4Packet::new(pkg.payload())?, &self.network_interface), + EtherTypes::Ipv4 => { + Self::handle_v4(Ipv4Packet::new(pkg.payload())?, &self.network_interface) + } _ => None, } } @@ -101,9 +103,7 @@ impl Sniffer { let to = SocketAddr::new(IpAddr::V4(ip_packet.get_destination()), destination_port); let connection = match direction { - Direction::Download => { - Connection::new(from, to.ip(), destination_port, protocol)? - }, + Direction::Download => Connection::new(from, to.ip(), destination_port, protocol)?, Direction::Upload => Connection::new(to, from.ip(), source_port, protocol)?, }; Some(Segment { diff --git a/src/tests/cases/raw_mode.rs b/src/tests/cases/raw_mode.rs index 054f37b..03c3684 100644 --- a/src/tests/cases/raw_mode.rs +++ b/src/tests/cases/raw_mode.rs @@ -37,7 +37,7 @@ fn build_tcp_packet( } fn build_ip_tcp_packet( - source_ip: &str, + source_ip: &str, destination_ip: &str, source_port: u16, destination_port: u16, |