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 {
if self.value > other.value {
Ordering::Greater
} else if self.value == other.value {
} else if (self.value - other.value).abs() < 0.01 {
Ordering::Equal
} else {
Ordering::Less
+6 -6
View File
@@ -329,8 +329,8 @@ impl AppData {
container.mem_limit
));
let net_rx_count = count(&container.rx.to_string());
let net_tx_count = count(&container.tx.to_string());
let rx_count = count(&container.rx.to_string());
let tx_count = count(&container.tx.to_string());
let image_count = count(&container.image);
let name_count = count(&container.name);
let state_count = count(&container.state.to_string());
@@ -354,11 +354,11 @@ impl AppData {
if status_count > output.status.1 {
output.status.1 = status_count;
};
if net_rx_count > output.net_rx.1 {
output.net_rx.1 = net_rx_count;
if rx_count > output.net_rx.1 {
output.net_rx.1 = rx_count;
};
if net_tx_count > output.net_tx.1 {
output.net_tx.1 = net_tx_count;
if tx_count > output.net_tx.1 {
output.net_tx.1 = tx_count;
};
}
output
+2 -2
View File
@@ -2,8 +2,8 @@
#![warn(clippy::unused_async, clippy::unwrap_used, clippy::expect_used)]
// Wanring - These are indeed pedantic
// #![warn(clippy::pedantic)]
#![warn(clippy::nursery)]
#![allow(clippy::module_name_repetitions, clippy::doc_markdown)]
// #![warn(clippy::nursery)]
// #![allow(clippy::module_name_repetitions, clippy::doc_markdown)]
// Only allow when debugging
// #![allow(unused)]
+5 -5
View File
@@ -147,12 +147,12 @@ fn ui<B: Backend>(
gui_state: &Arc<Mutex<GuiState>>,
) {
// 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();
if height < 12 {
height += 4;
let height = app_data.lock().get_container_len();
let height = if height < 12 {
(height + 4) as u16
} else {
height = 12;
}
12
};
let column_widths = app_data.lock().get_width();
let has_containers = !app_data.lock().containers.items.is_empty();