diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2023-03-11 01:20:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 01:20:46 -0500 |
commit | c2d66af72f5b38d450fa15d0e5d8382d5308b93c (patch) | |
tree | f17e8bce51b5f1e59c05d1b9260c80213d547a19 /src/app | |
parent | e7a5f297bca3590b39541f8674d93187630d3014 (diff) |
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
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/data_harvester/temperature.rs | 9 | ||||
-rw-r--r-- | src/app/layout_manager.rs | 9 |
2 files changed, 4 insertions, 14 deletions
diff --git a/src/app/data_harvester/temperature.rs b/src/app/data_harvester/temperature.rs index 82cf38f4..4ad76232 100644 --- a/src/app/data_harvester/temperature.rs +++ b/src/app/data_harvester/temperature.rs @@ -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 } diff --git a/src/app/layout_manager.rs b/src/app/layout_manager.rs index fab2d918..abc60899 100644 --- a/src/app/layout_manager.rs +++ b/src/app/layout_manager.rs @@ -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; |