mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-26 06:00:21 +00:00
clippy: appease clippy as of Rust 1.68.0 (#1055)
* clippy: fix derivable_impls clippy warning This was done using `cargo clippy --fix` * cargo fmt after autofix
This commit is contained in:
parent
e7a5f297bc
commit
c2d66af72f
6 changed files with 12 additions and 42 deletions
|
@ -33,18 +33,13 @@ pub mod states;
|
|||
|
||||
use frozen_state::FrozenState;
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Default)]
|
||||
pub enum AxisScaling {
|
||||
#[default]
|
||||
Log,
|
||||
Linear,
|
||||
}
|
||||
|
||||
impl Default for AxisScaling {
|
||||
fn default() -> Self {
|
||||
AxisScaling::Log
|
||||
}
|
||||
}
|
||||
|
||||
/// AppConfigFields is meant to cover basic fields that would normally be set
|
||||
/// by config files or launch options.
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
|
|
|
@ -24,19 +24,14 @@ pub struct TempHarvest {
|
|||
pub temperature: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Copy, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Copy, PartialEq, Eq, Default)]
|
||||
pub enum TemperatureType {
|
||||
#[default]
|
||||
Celsius,
|
||||
Kelvin,
|
||||
Fahrenheit,
|
||||
}
|
||||
|
||||
impl Default for TemperatureType {
|
||||
fn default() -> Self {
|
||||
TemperatureType::Celsius
|
||||
}
|
||||
}
|
||||
|
||||
fn convert_celsius_to_kelvin(celsius: f32) -> f32 {
|
||||
celsius + 273.15
|
||||
}
|
||||
|
|
|
@ -882,8 +882,9 @@ pub struct BottomWidget {
|
|||
pub bottom_right_corner: Option<(u16, u16)>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Hash, Default)]
|
||||
pub enum BottomWidgetType {
|
||||
#[default]
|
||||
Empty,
|
||||
Cpu,
|
||||
CpuLegend,
|
||||
|
@ -927,12 +928,6 @@ impl BottomWidgetType {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for BottomWidgetType {
|
||||
fn default() -> Self {
|
||||
BottomWidgetType::Empty
|
||||
}
|
||||
}
|
||||
|
||||
impl std::str::FromStr for BottomWidgetType {
|
||||
type Err = BottomError;
|
||||
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
use tui::{layout::Rect, widgets::TableState};
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
|
||||
pub enum ScrollDirection {
|
||||
// UP means scrolling up --- this usually DECREMENTS
|
||||
Up,
|
||||
|
||||
// DOWN means scrolling down --- this usually INCREMENTS
|
||||
#[default]
|
||||
Down,
|
||||
}
|
||||
|
||||
impl Default for ScrollDirection {
|
||||
fn default() -> Self {
|
||||
ScrollDirection::Down
|
||||
}
|
||||
}
|
||||
|
||||
/// Internal state representation of a [`DataTable`](super::DataTable).
|
||||
pub struct DataTableState {
|
||||
/// The index from where to start displaying the rows.
|
||||
|
|
|
@ -13,19 +13,14 @@ use crate::units::data_units::DataUnit;
|
|||
use crate::utils::gen_util::*;
|
||||
use crate::widgets::{DiskWidgetData, TempWidgetData};
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default)]
|
||||
pub enum BatteryDuration {
|
||||
ToEmpty(i64),
|
||||
ToFull(i64),
|
||||
#[default]
|
||||
Unknown,
|
||||
}
|
||||
|
||||
impl Default for BatteryDuration {
|
||||
fn default() -> Self {
|
||||
BatteryDuration::Unknown
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
pub struct ConvertedBatteryData {
|
||||
pub battery_name: String,
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Default)]
|
||||
pub enum DataUnit {
|
||||
Byte,
|
||||
#[default]
|
||||
Bit,
|
||||
}
|
||||
|
||||
impl Default for DataUnit {
|
||||
fn default() -> Self {
|
||||
DataUnit::Bit
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue