diff options
author | cyqsimon <28627918+cyqsimon@users.noreply.github.com> | 2023-08-25 20:16:33 +0800 |
---|---|---|
committer | cyqsimon <28627918+cyqsimon@users.noreply.github.com> | 2023-08-25 20:16:33 +0800 |
commit | 42ae443bd3c3eb8150a8b0a0a681bc8ab315214f (patch) | |
tree | c14fd72169bddd87133d4258d9a25c8701fedc1a /src/display/ui.rs | |
parent | fb176a5212e2e1aba41e181648723e8048da2a2c (diff) |
Use variable capture syntax in format macros where possible
Diffstat (limited to 'src/display/ui.rs')
-rw-r--r-- | src/display/ui.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/display/ui.rs b/src/display/ui.rs index 54811b8..f70633f 100644 --- a/src/display/ui.rs +++ b/src/display/ui.rs @@ -52,9 +52,7 @@ where no_traffic: &mut bool| { for (process, process_network_data) in &state.processes { write_to_stdout(format!( - "process: <{}> \"{}\" up/down Bps: {}/{} connections: {}", - timestamp, - process, + "process: <{timestamp}> \"{process}\" up/down Bps: {}/{} connections: {}", process_network_data.total_bytes_uploaded, process_network_data.total_bytes_downloaded, process_network_data.connection_count @@ -67,8 +65,7 @@ where |write_to_stdout: &mut (dyn FnMut(String) + Send), no_traffic: &mut bool| { for (connection, connection_network_data) in &state.connections { write_to_stdout(format!( - "connection: <{}> {} up/down Bps: {}/{} process: \"{}\"", - timestamp, + "connection: <{timestamp}> {} up/down Bps: {}/{} process: \"{}\"", display_connection_string( connection, ip_to_host, @@ -86,8 +83,7 @@ where no_traffic: &mut bool| { for (remote_address, remote_address_network_data) in &state.remote_addresses { write_to_stdout(format!( - "remote_address: <{}> {} up/down Bps: {}/{} connections: {}", - timestamp, + "remote_address: <{timestamp}> {} up/down Bps: {}/{} connections: {}", display_ip_or_host(*remote_address, ip_to_host), remote_address_network_data.total_bytes_uploaded, remote_address_network_data.total_bytes_downloaded, |