From 712a0036811d1ec1f676b2ba76fff4bf5cc5fa97 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 23 Oct 2023 23:53:08 -0400 Subject: Chore: Remove un-needed lifetimes in a few calls (#1309) --- src/components/data_table.rs | 6 +++--- src/components/data_table/data_type.rs | 2 +- src/components/data_table/sortable.rs | 6 +++--- src/widgets/cpu_graph.rs | 2 +- src/widgets/disk_table.rs | 2 +- src/widgets/process_table/proc_widget_data.rs | 2 +- src/widgets/process_table/sort_table.rs | 4 ++-- src/widgets/temperature_table.rs | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/data_table.rs b/src/components/data_table.rs index 650e14a5..5fb5cb2c 100644 --- a/src/components/data_table.rs +++ b/src/components/data_table.rs @@ -155,9 +155,9 @@ mod test { } impl DataToCell<&'static str> for TestType { - fn to_cell<'a>( - &'a self, _column: &&'static str, _calculated_width: u16, - ) -> Option> { + fn to_cell( + &self, _column: &&'static str, _calculated_width: u16, + ) -> Option> { None } diff --git a/src/components/data_table/data_type.rs b/src/components/data_table/data_type.rs index 6fad3196..bbfceb8c 100644 --- a/src/components/data_table/data_type.rs +++ b/src/components/data_table/data_type.rs @@ -8,7 +8,7 @@ where H: ColumnHeader, { /// Given data, a column, and its corresponding width, return what should be displayed in the [`DataTable`](super::DataTable). - fn to_cell<'a>(&'a self, column: &H, calculated_width: u16) -> Option>; + fn to_cell(&self, column: &H, calculated_width: u16) -> Option>; /// Apply styling to the generated [`Row`] of cells. /// diff --git a/src/components/data_table/sortable.rs b/src/components/data_table/sortable.rs index 28262358..b44906a4 100644 --- a/src/components/data_table/sortable.rs +++ b/src/components/data_table/sortable.rs @@ -359,9 +359,9 @@ mod test { } impl DataToCell for TestType { - fn to_cell<'a>( - &'a self, _column: &ColumnType, _calculated_width: u16, - ) -> Option> { + fn to_cell( + &self, _column: &ColumnType, _calculated_width: u16, + ) -> Option> { None } diff --git a/src/widgets/cpu_graph.rs b/src/widgets/cpu_graph.rs index 46ec1fc4..2b555c10 100644 --- a/src/widgets/cpu_graph.rs +++ b/src/widgets/cpu_graph.rs @@ -76,7 +76,7 @@ impl CpuWidgetTableData { } impl DataToCell for CpuWidgetTableData { - fn to_cell<'a>(&'a self, column: &CpuWidgetColumn, calculated_width: u16) -> Option> { + fn to_cell(&self, column: &CpuWidgetColumn, calculated_width: u16) -> Option> { const CPU_TRUNCATE_BREAKPOINT: u16 = 5; // This is a bit of a hack, but apparently we can avoid having to do any fancy checks diff --git a/src/widgets/disk_table.rs b/src/widgets/disk_table.rs index e0927746..45549e13 100644 --- a/src/widgets/disk_table.rs +++ b/src/widgets/disk_table.rs @@ -126,7 +126,7 @@ impl ColumnHeader for DiskWidgetColumn { } impl DataToCell for DiskWidgetData { - fn to_cell<'a>(&'a self, column: &DiskWidgetColumn, calculated_width: u16) -> Option> { + fn to_cell(&self, column: &DiskWidgetColumn, calculated_width: u16) -> Option> { if calculated_width == 0 { return None; } diff --git a/src/widgets/process_table/proc_widget_data.rs b/src/widgets/process_table/proc_widget_data.rs index a466f58d..925bbe65 100644 --- a/src/widgets/process_table/proc_widget_data.rs +++ b/src/widgets/process_table/proc_widget_data.rs @@ -269,7 +269,7 @@ impl ProcWidgetData { } impl DataToCell for ProcWidgetData { - fn to_cell<'a>(&'a self, column: &ProcColumn, calculated_width: u16) -> Option> { + fn to_cell(&self, column: &ProcColumn, calculated_width: u16) -> Option> { if calculated_width == 0 { return None; } diff --git a/src/widgets/process_table/sort_table.rs b/src/widgets/process_table/sort_table.rs index 0a0e1e1c..30adb753 100644 --- a/src/widgets/process_table/sort_table.rs +++ b/src/widgets/process_table/sort_table.rs @@ -16,7 +16,7 @@ impl ColumnHeader for SortTableColumn { } impl DataToCell for &'static str { - fn to_cell<'a>(&'a self, _column: &SortTableColumn, calculated_width: u16) -> Option> { + fn to_cell(&self, _column: &SortTableColumn, calculated_width: u16) -> Option> { if calculated_width == 0 { return None; } @@ -33,7 +33,7 @@ impl DataToCell for &'static str { } impl DataToCell for Cow<'static, str> { - fn to_cell<'a>(&'a self, _column: &SortTableColumn, calculated_width: u16) -> Option> { + fn to_cell(&self, _column: &SortTableColumn, calculated_width: u16) -> Option> { if calculated_width == 0 { return None; } diff --git a/src/widgets/temperature_table.rs b/src/widgets/temperature_table.rs index 85d3b85d..1c8fe67c 100644 --- a/src/widgets/temperature_table.rs +++ b/src/widgets/temperature_table.rs @@ -48,7 +48,7 @@ impl TempWidgetData { } impl DataToCell for TempWidgetData { - fn to_cell<'a>(&'a self, column: &TempWidgetColumn, calculated_width: u16) -> Option> { + fn to_cell(&self, column: &TempWidgetColumn, calculated_width: u16) -> Option> { if calculated_width == 0 { return None; } -- cgit v1.2.3