Chore: Remove un-needed lifetimes in a few calls (#1309)

This commit is contained in:
Yuri Astrakhan 2023-10-23 23:53:08 -04:00 committed by GitHub
parent 1e16456d5f
commit 712a003681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 13 deletions

View File

@ -155,9 +155,9 @@ mod test {
} }
impl DataToCell<&'static str> for TestType { impl DataToCell<&'static str> for TestType {
fn to_cell<'a>( fn to_cell(
&'a self, _column: &&'static str, _calculated_width: u16, &self, _column: &&'static str, _calculated_width: u16,
) -> Option<tui::text::Text<'a>> { ) -> Option<tui::text::Text<'_>> {
None None
} }

View File

@ -8,7 +8,7 @@ where
H: ColumnHeader, H: ColumnHeader,
{ {
/// Given data, a column, and its corresponding width, return what should be displayed in the [`DataTable`](super::DataTable). /// 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<Text<'a>>; fn to_cell(&self, column: &H, calculated_width: u16) -> Option<Text<'_>>;
/// Apply styling to the generated [`Row`] of cells. /// Apply styling to the generated [`Row`] of cells.
/// ///

View File

@ -359,9 +359,9 @@ mod test {
} }
impl DataToCell<ColumnType> for TestType { impl DataToCell<ColumnType> for TestType {
fn to_cell<'a>( fn to_cell(
&'a self, _column: &ColumnType, _calculated_width: u16, &self, _column: &ColumnType, _calculated_width: u16,
) -> Option<tui::text::Text<'a>> { ) -> Option<tui::text::Text<'_>> {
None None
} }

View File

@ -76,7 +76,7 @@ impl CpuWidgetTableData {
} }
impl DataToCell<CpuWidgetColumn> for CpuWidgetTableData { impl DataToCell<CpuWidgetColumn> for CpuWidgetTableData {
fn to_cell<'a>(&'a self, column: &CpuWidgetColumn, calculated_width: u16) -> Option<Text<'a>> { fn to_cell(&self, column: &CpuWidgetColumn, calculated_width: u16) -> Option<Text<'_>> {
const CPU_TRUNCATE_BREAKPOINT: u16 = 5; const CPU_TRUNCATE_BREAKPOINT: u16 = 5;
// This is a bit of a hack, but apparently we can avoid having to do any fancy checks // This is a bit of a hack, but apparently we can avoid having to do any fancy checks

View File

@ -126,7 +126,7 @@ impl ColumnHeader for DiskWidgetColumn {
} }
impl DataToCell<DiskWidgetColumn> for DiskWidgetData { impl DataToCell<DiskWidgetColumn> for DiskWidgetData {
fn to_cell<'a>(&'a self, column: &DiskWidgetColumn, calculated_width: u16) -> Option<Text<'a>> { fn to_cell(&self, column: &DiskWidgetColumn, calculated_width: u16) -> Option<Text<'_>> {
if calculated_width == 0 { if calculated_width == 0 {
return None; return None;
} }

View File

@ -269,7 +269,7 @@ impl ProcWidgetData {
} }
impl DataToCell<ProcColumn> for ProcWidgetData { impl DataToCell<ProcColumn> for ProcWidgetData {
fn to_cell<'a>(&'a self, column: &ProcColumn, calculated_width: u16) -> Option<Text<'a>> { fn to_cell(&self, column: &ProcColumn, calculated_width: u16) -> Option<Text<'_>> {
if calculated_width == 0 { if calculated_width == 0 {
return None; return None;
} }

View File

@ -16,7 +16,7 @@ impl ColumnHeader for SortTableColumn {
} }
impl DataToCell<SortTableColumn> for &'static str { impl DataToCell<SortTableColumn> for &'static str {
fn to_cell<'a>(&'a self, _column: &SortTableColumn, calculated_width: u16) -> Option<Text<'a>> { fn to_cell(&self, _column: &SortTableColumn, calculated_width: u16) -> Option<Text<'_>> {
if calculated_width == 0 { if calculated_width == 0 {
return None; return None;
} }
@ -33,7 +33,7 @@ impl DataToCell<SortTableColumn> for &'static str {
} }
impl DataToCell<SortTableColumn> for Cow<'static, str> { impl DataToCell<SortTableColumn> for Cow<'static, str> {
fn to_cell<'a>(&'a self, _column: &SortTableColumn, calculated_width: u16) -> Option<Text<'a>> { fn to_cell(&self, _column: &SortTableColumn, calculated_width: u16) -> Option<Text<'_>> {
if calculated_width == 0 { if calculated_width == 0 {
return None; return None;
} }

View File

@ -48,7 +48,7 @@ impl TempWidgetData {
} }
impl DataToCell<TempWidgetColumn> for TempWidgetData { impl DataToCell<TempWidgetColumn> for TempWidgetData {
fn to_cell<'a>(&'a self, column: &TempWidgetColumn, calculated_width: u16) -> Option<Text<'a>> { fn to_cell(&self, column: &TempWidgetColumn, calculated_width: u16) -> Option<Text<'_>> {
if calculated_width == 0 { if calculated_width == 0 {
return None; return None;
} }