mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 05:34:57 +02: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
@ -33,18 +33,13 @@ pub mod states;
|
|||||||
|
|
||||||
use frozen_state::FrozenState;
|
use frozen_state::FrozenState;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
#[derive(Debug, Clone, Eq, PartialEq, Default)]
|
||||||
pub enum AxisScaling {
|
pub enum AxisScaling {
|
||||||
|
#[default]
|
||||||
Log,
|
Log,
|
||||||
Linear,
|
Linear,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for AxisScaling {
|
|
||||||
fn default() -> Self {
|
|
||||||
AxisScaling::Log
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// AppConfigFields is meant to cover basic fields that would normally be set
|
/// AppConfigFields is meant to cover basic fields that would normally be set
|
||||||
/// by config files or launch options.
|
/// by config files or launch options.
|
||||||
#[derive(Debug, Default, Eq, PartialEq)]
|
#[derive(Debug, Default, Eq, PartialEq)]
|
||||||
|
@ -24,19 +24,14 @@ pub struct TempHarvest {
|
|||||||
pub temperature: f32,
|
pub temperature: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Copy, PartialEq, Eq)]
|
#[derive(Clone, Debug, Copy, PartialEq, Eq, Default)]
|
||||||
pub enum TemperatureType {
|
pub enum TemperatureType {
|
||||||
|
#[default]
|
||||||
Celsius,
|
Celsius,
|
||||||
Kelvin,
|
Kelvin,
|
||||||
Fahrenheit,
|
Fahrenheit,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TemperatureType {
|
|
||||||
fn default() -> Self {
|
|
||||||
TemperatureType::Celsius
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn convert_celsius_to_kelvin(celsius: f32) -> f32 {
|
fn convert_celsius_to_kelvin(celsius: f32) -> f32 {
|
||||||
celsius + 273.15
|
celsius + 273.15
|
||||||
}
|
}
|
||||||
|
@ -882,8 +882,9 @@ pub struct BottomWidget {
|
|||||||
pub bottom_right_corner: Option<(u16, u16)>,
|
pub bottom_right_corner: Option<(u16, u16)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
|
#[derive(Debug, Clone, Eq, PartialEq, Hash, Default)]
|
||||||
pub enum BottomWidgetType {
|
pub enum BottomWidgetType {
|
||||||
|
#[default]
|
||||||
Empty,
|
Empty,
|
||||||
Cpu,
|
Cpu,
|
||||||
CpuLegend,
|
CpuLegend,
|
||||||
@ -927,12 +928,6 @@ impl BottomWidgetType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for BottomWidgetType {
|
|
||||||
fn default() -> Self {
|
|
||||||
BottomWidgetType::Empty
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::str::FromStr for BottomWidgetType {
|
impl std::str::FromStr for BottomWidgetType {
|
||||||
type Err = BottomError;
|
type Err = BottomError;
|
||||||
|
|
||||||
|
@ -1,20 +1,15 @@
|
|||||||
use tui::{layout::Rect, widgets::TableState};
|
use tui::{layout::Rect, widgets::TableState};
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
|
||||||
pub enum ScrollDirection {
|
pub enum ScrollDirection {
|
||||||
// UP means scrolling up --- this usually DECREMENTS
|
// UP means scrolling up --- this usually DECREMENTS
|
||||||
Up,
|
Up,
|
||||||
|
|
||||||
// DOWN means scrolling down --- this usually INCREMENTS
|
// DOWN means scrolling down --- this usually INCREMENTS
|
||||||
|
#[default]
|
||||||
Down,
|
Down,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ScrollDirection {
|
|
||||||
fn default() -> Self {
|
|
||||||
ScrollDirection::Down
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Internal state representation of a [`DataTable`](super::DataTable).
|
/// Internal state representation of a [`DataTable`](super::DataTable).
|
||||||
pub struct DataTableState {
|
pub struct DataTableState {
|
||||||
/// The index from where to start displaying the rows.
|
/// 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::utils::gen_util::*;
|
||||||
use crate::widgets::{DiskWidgetData, TempWidgetData};
|
use crate::widgets::{DiskWidgetData, TempWidgetData};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Default)]
|
||||||
pub enum BatteryDuration {
|
pub enum BatteryDuration {
|
||||||
ToEmpty(i64),
|
ToEmpty(i64),
|
||||||
ToFull(i64),
|
ToFull(i64),
|
||||||
|
#[default]
|
||||||
Unknown,
|
Unknown,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for BatteryDuration {
|
|
||||||
fn default() -> Self {
|
|
||||||
BatteryDuration::Unknown
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
pub struct ConvertedBatteryData {
|
pub struct ConvertedBatteryData {
|
||||||
pub battery_name: String,
|
pub battery_name: String,
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
#[derive(Debug, Clone, Eq, PartialEq, Default)]
|
||||||
pub enum DataUnit {
|
pub enum DataUnit {
|
||||||
Byte,
|
Byte,
|
||||||
|
#[default]
|
||||||
Bit,
|
Bit,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for DataUnit {
|
|
||||||
fn default() -> Self {
|
|
||||||
DataUnit::Bit
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user