diff options
author | Rupert Rutledge <eosis2 [at] gmail.com> | 2020-05-16 18:07:17 +0100 |
---|---|---|
committer | Rupert Rutledge <eosis2 [at] gmail.com> | 2020-05-16 18:07:17 +0100 |
commit | 18de3a1aea94fd93a18675ae6018bdf64e5d28d4 (patch) | |
tree | a2d8a59e7bafb9e26419b4b6f3ed72cfe285ad61 /src/display | |
parent | 07c734a90d4babca5eb9d93825deee0e8348d855 (diff) | |
parent | e6bb39a5e992498e00bc3af47d92352865e3223d (diff) |
Merge remote-tracking branch 'origin/master' into issue-163-elapsed-time
Diffstat (limited to 'src/display')
-rw-r--r-- | src/display/components/display_bandwidth.rs | 4 | ||||
-rw-r--r-- | src/display/ui_state.rs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/display/components/display_bandwidth.rs b/src/display/components/display_bandwidth.rs index dcc204c..04f1e89 100644 --- a/src/display/components/display_bandwidth.rs +++ b/src/display/components/display_bandwidth.rs @@ -8,7 +8,9 @@ pub struct DisplayBandwidth { impl fmt::Display for DisplayBandwidth { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let suffix = if self.as_rate { "ps" } else { "" }; - if self.bandwidth > 999_999_999.0 { + if self.bandwidth > 999_999_999_999.0 { + write!(f, "{:.2}TB{}", self.bandwidth / 1_000_000_000_000.0, suffix) + } else if self.bandwidth > 999_999_999.0 { write!(f, "{:.2}GB{}", self.bandwidth / 1_000_000_000.0, suffix) } else if self.bandwidth > 999_999.0 { write!(f, "{:.2}MB{}", self.bandwidth / 1_000_000.0, suffix) diff --git a/src/display/ui_state.rs b/src/display/ui_state.rs index a65e610..8872cd8 100644 --- a/src/display/ui_state.rs +++ b/src/display/ui_state.rs @@ -131,7 +131,7 @@ impl UIState { for (connection, connection_info) in &network_utilization.connections { let connection_previously_seen = !seen_connections.insert(connection); - let connection_data = connections.entry(connection.clone()).or_default(); + let connection_data = connections.entry(*connection).or_default(); let data_for_remote_address = remote_addresses .entry(connection.remote_socket.ip) .or_default(); |