diff --git a/src/app/states.rs b/src/app/states.rs index 75b27fba..3dff4644 100644 --- a/src/app/states.rs +++ b/src/app/states.rs @@ -411,19 +411,3 @@ pub struct ParagraphScrollState { pub current_scroll_index: u16, pub max_scroll_index: u16, } - -#[derive(Default)] -pub struct ConfigState { - pub current_category_index: usize, - pub category_list: Vec, -} - -#[derive(Default)] -pub struct ConfigCategory { - pub category_name: &'static str, - pub options_list: Vec, -} - -pub struct ConfigOption { - pub set_function: Box anyhow::Result<()>>, -} diff --git a/src/app/widgets/process_widget.rs b/src/app/widgets/process_widget.rs index 1189d0ce..74d4c3bf 100644 --- a/src/app/widgets/process_widget.rs +++ b/src/app/widgets/process_widget.rs @@ -166,6 +166,7 @@ impl ProcWidgetColumn { }) } } else { + #[allow(clippy::collapsible-else-if)] if sort_descending { data.sort_by_cached_key(|p| { Reverse(name_pid_map.get(&p.name).map(|v| v.len()).unwrap_or(0)) @@ -501,7 +502,7 @@ impl ProcWidget { { let shown_children = children_pids .iter() - .filter(|pid| visited_pids.get(*pid).map(|b| *b).unwrap_or(false)) + .filter(|pid| visited_pids.get(*pid).copied().unwrap_or(false)) .collect_vec(); let is_shown = is_process_matching || !shown_children.is_empty(); visited_pids.insert(process.pid, is_shown); @@ -545,7 +546,7 @@ impl ProcWidget { .filter_map(|child| process_harvest.get(child)) .collect_vec(); - self.try_sort(&mut stack, &data_collection); + self.try_sort(&mut stack, data_collection); let mut length_stack = vec![stack.len()]; @@ -687,8 +688,8 @@ impl ProcWidget { filtered_iter.collect::>() }; - self.try_sort(&mut filtered_data, &data_collection); - self.harvest_to_table_data(&filtered_data, &data_collection) + self.try_sort(&mut filtered_data, data_collection); + self.harvest_to_table_data(&filtered_data, data_collection) } fn try_sort(&self, filtered_data: &mut [&ProcessHarvest], data_collection: &DataCollection) { diff --git a/src/canvas.rs b/src/canvas.rs index 43e61b44..6736c96a 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -69,6 +69,8 @@ pub struct Painter { width: u16, styled_help_text: Vec>, is_mac_os: bool, // FIXME: This feels out of place... + + // FIXME: Redo this entire thing. row_constraints: Vec, col_constraints: Vec>, col_row_constraints: Vec>>, diff --git a/src/canvas/components/text_table.rs b/src/canvas/components/text_table.rs index 27489ed7..20b956de 100644 --- a/src/canvas/components/text_table.rs +++ b/src/canvas/components/text_table.rs @@ -324,7 +324,7 @@ fn build_header<'a, H: TableComponentHeader>( } /// Truncates text if it is too long, and adds an ellipsis at the end if needed. -fn truncate_text<'a>(content: &'a CellContent, width: usize, row_style: Option