chore: linting warns removed

This commit is contained in:
Jack Wills
2022-08-04 13:29:09 +00:00
parent 0e11767db8
commit 258ada731b
4 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -223,7 +223,7 @@ impl Ord for CpuStats {
fn cmp(&self, other: &Self) -> Ordering { fn cmp(&self, other: &Self) -> Ordering {
if self.value > other.value { if self.value > other.value {
Ordering::Greater Ordering::Greater
} else if self.value == other.value { } else if (self.value - other.value).abs() < 0.01 {
Ordering::Equal Ordering::Equal
} else { } else {
Ordering::Less Ordering::Less
+6 -6
View File
@@ -329,8 +329,8 @@ impl AppData {
container.mem_limit container.mem_limit
)); ));
let net_rx_count = count(&container.rx.to_string()); let rx_count = count(&container.rx.to_string());
let net_tx_count = count(&container.tx.to_string()); let tx_count = count(&container.tx.to_string());
let image_count = count(&container.image); let image_count = count(&container.image);
let name_count = count(&container.name); let name_count = count(&container.name);
let state_count = count(&container.state.to_string()); let state_count = count(&container.state.to_string());
@@ -354,11 +354,11 @@ impl AppData {
if status_count > output.status.1 { if status_count > output.status.1 {
output.status.1 = status_count; output.status.1 = status_count;
}; };
if net_rx_count > output.net_rx.1 { if rx_count > output.net_rx.1 {
output.net_rx.1 = net_rx_count; output.net_rx.1 = rx_count;
}; };
if net_tx_count > output.net_tx.1 { if tx_count > output.net_tx.1 {
output.net_tx.1 = net_tx_count; output.net_tx.1 = tx_count;
}; };
} }
output output
+2 -2
View File
@@ -2,8 +2,8 @@
#![warn(clippy::unused_async, clippy::unwrap_used, clippy::expect_used)] #![warn(clippy::unused_async, clippy::unwrap_used, clippy::expect_used)]
// Wanring - These are indeed pedantic // Wanring - These are indeed pedantic
// #![warn(clippy::pedantic)] // #![warn(clippy::pedantic)]
#![warn(clippy::nursery)] // #![warn(clippy::nursery)]
#![allow(clippy::module_name_repetitions, clippy::doc_markdown)] // #![allow(clippy::module_name_repetitions, clippy::doc_markdown)]
// Only allow when debugging // Only allow when debugging
// #![allow(unused)] // #![allow(unused)]
+5 -5
View File
@@ -147,12 +147,12 @@ fn ui<B: Backend>(
gui_state: &Arc<Mutex<GuiState>>, gui_state: &Arc<Mutex<GuiState>>,
) { ) {
// set max height for container section, needs +4 to deal with docker commands list and borders // set max height for container section, needs +4 to deal with docker commands list and borders
let mut height = app_data.lock().get_container_len(); let height = app_data.lock().get_container_len();
if height < 12 { let height = if height < 12 {
height += 4; (height + 4) as u16
} else { } else {
height = 12; 12
} };
let column_widths = app_data.lock().get_width(); let column_widths = app_data.lock().get_width();
let has_containers = !app_data.lock().containers.items.is_empty(); let has_containers = !app_data.lock().containers.items.is_empty();