diff options
Diffstat (limited to 'src/app/widgets/process_table/sort_table.rs')
-rw-r--r-- | src/app/widgets/process_table/sort_table.rs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/app/widgets/process_table/sort_table.rs b/src/app/widgets/process_table/sort_table.rs deleted file mode 100644 index 5ace0ecb..00000000 --- a/src/app/widgets/process_table/sort_table.rs +++ /dev/null @@ -1,42 +0,0 @@ -use std::borrow::Cow; - -use tui::text::Text; - -use crate::{ - components::data_table::{ColumnHeader, DataTableColumn, DataToCell}, - utils::gen_util::truncate_text, -}; - -pub struct SortTableColumn; - -impl ColumnHeader for SortTableColumn { - fn text(&self) -> std::borrow::Cow<'static, str> { - "Sort By".into() - } -} - -impl DataToCell<SortTableColumn> for &'static str { - fn to_cell<'a>(&'a self, _column: &SortTableColumn, calculated_width: u16) -> Option<Text<'a>> { - Some(truncate_text(self, calculated_width)) - } - - fn column_widths<C: DataTableColumn<SortTableColumn>>(data: &[Self], _columns: &[C]) -> Vec<u16> - where - Self: Sized, - { - vec![data.iter().map(|d| d.len() as u16).max().unwrap_or(0)] - } -} - -impl DataToCell<SortTableColumn> for Cow<'static, str> { - fn to_cell<'a>(&'a self, _column: &SortTableColumn, calculated_width: u16) -> Option<Text<'a>> { - Some(truncate_text(self, calculated_width)) - } - - fn column_widths<C: DataTableColumn<SortTableColumn>>(data: &[Self], _columns: &[C]) -> Vec<u16> - where - Self: Sized, - { - vec![data.iter().map(|d| d.len() as u16).max().unwrap_or(0)] - } -} |