mirror of
https://github.com/ClementTsang/bottom.git
synced 2024-09-17 14:37:31 +03:00
Chore: Remove un-needed lifetimes in a few calls (#1309)
This commit is contained in:
parent
1e16456d5f
commit
712a003681
@ -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<tui::text::Text<'a>> {
|
||||
fn to_cell(
|
||||
&self, _column: &&'static str, _calculated_width: u16,
|
||||
) -> Option<tui::text::Text<'_>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -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<Text<'a>>;
|
||||
fn to_cell(&self, column: &H, calculated_width: u16) -> Option<Text<'_>>;
|
||||
|
||||
/// Apply styling to the generated [`Row`] of cells.
|
||||
///
|
||||
|
@ -359,9 +359,9 @@ mod test {
|
||||
}
|
||||
|
||||
impl DataToCell<ColumnType> for TestType {
|
||||
fn to_cell<'a>(
|
||||
&'a self, _column: &ColumnType, _calculated_width: u16,
|
||||
) -> Option<tui::text::Text<'a>> {
|
||||
fn to_cell(
|
||||
&self, _column: &ColumnType, _calculated_width: u16,
|
||||
) -> Option<tui::text::Text<'_>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ impl 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;
|
||||
|
||||
// This is a bit of a hack, but apparently we can avoid having to do any fancy checks
|
||||
|
@ -126,7 +126,7 @@ impl ColumnHeader for DiskWidgetColumn {
|
||||
}
|
||||
|
||||
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 {
|
||||
return None;
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ impl 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 {
|
||||
return None;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ impl ColumnHeader for SortTableColumn {
|
||||
}
|
||||
|
||||
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 {
|
||||
return None;
|
||||
}
|
||||
@ -33,7 +33,7 @@ impl DataToCell<SortTableColumn> for &'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 {
|
||||
return None;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ impl 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 {
|
||||
return None;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user