diff options
author | Kelvin Zhang <zhangxp1998@gmail.com> | 2020-01-07 15:08:16 -0500 |
---|---|---|
committer | Kelvin Zhang <zhangxp1998@gmail.com> | 2020-01-07 16:40:07 -0500 |
commit | 471fd861d5799b14f819e388246bf8a564ca98a6 (patch) | |
tree | ce1cd5086abbe2de5037270702c7057c769fd850 /src/tests/fakes | |
parent | cf772acba35467b25ab59fef644199839882bc4a (diff) |
Address some comments on PR
Diffstat (limited to 'src/tests/fakes')
-rw-r--r-- | src/tests/fakes/fake_input.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tests/fakes/fake_input.rs b/src/tests/fakes/fake_input.rs index 8faaa41..38b14cb 100644 --- a/src/tests/fakes/fake_input.rs +++ b/src/tests/fakes/fake_input.rs @@ -13,9 +13,10 @@ use ::termion::event::Event; use crate::{ network::{ dns::{self, Lookup}, - Connection, LocalSocket, Protocol, + Connection, Protocol, }, os::OnSigWinch, + OpenSockets, }; pub struct KeyboardEvents { @@ -85,7 +86,7 @@ impl DataLinkReceiver for NetworkFrames { } } -pub fn get_open_sockets() -> (HashMap<LocalSocket, String>, std::vec::Vec<Connection>) { +pub fn get_open_sockets() -> OpenSockets { let mut open_sockets = HashMap::new(); let local_ip = IpAddr::V4(Ipv4Addr::new(10, 0, 0, 2)); open_sockets.insert( @@ -145,7 +146,10 @@ pub fn get_open_sockets() -> (HashMap<LocalSocket, String>, std::vec::Vec<Connec connections.push(connection); } - (local_socket_to_procs, connections) + OpenSockets { + sockets_to_procs: local_socket_to_procs, + connections, + } } pub fn get_interfaces() -> Vec<NetworkInterface> { |