Skip to content

Commit abae82e

Browse files
committed
chore: fix latest clippy warnings
1 parent 2c11d67 commit abae82e

File tree

3 files changed

+6
-29
lines changed

3 files changed

+6
-29
lines changed

src/config/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,22 +221,17 @@ pub enum MonitorConfig {
221221
Multiple(Vec<BarConfig>),
222222
}
223223

224-
#[derive(Debug, Deserialize, Copy, Clone, PartialEq, Eq)]
224+
#[derive(Debug, Default, Deserialize, Copy, Clone, PartialEq, Eq)]
225225
#[serde(rename_all = "snake_case")]
226226
#[cfg_attr(feature = "extras", derive(JsonSchema))]
227227
pub enum BarPosition {
228228
Top,
229+
#[default]
229230
Bottom,
230231
Left,
231232
Right,
232233
}
233234

234-
impl Default for BarPosition {
235-
fn default() -> Self {
236-
Self::Bottom
237-
}
238-
}
239-
240235
#[derive(Debug, Default, Deserialize, Copy, Clone, PartialEq, Eq)]
241236
#[cfg_attr(feature = "extras", derive(JsonSchema))]
242237
#[serde(default)]

src/modules/music/config.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,17 @@ use dirs::{audio_dir, home_dir};
33
use serde::Deserialize;
44
use std::path::PathBuf;
55

6-
#[derive(Debug, Deserialize, Clone, Copy)]
6+
#[derive(Debug, Default, Deserialize, Clone, Copy)]
77
#[serde(rename_all = "snake_case")]
88
#[cfg_attr(feature = "extras", derive(schemars::JsonSchema))]
99
pub enum PlayerType {
1010
#[cfg(feature = "music+mpd")]
1111
Mpd,
1212
#[cfg(feature = "music+mpris")]
13+
#[default]
1314
Mpris,
1415
}
1516

16-
impl Default for PlayerType {
17-
fn default() -> Self {
18-
cfg_if::cfg_if! {
19-
if #[cfg(feature = "music+mpris")] {
20-
Self::Mpris
21-
} else if #[cfg(feature = "music+mpd")] {
22-
Self::Mpd
23-
} else {
24-
compile_error!("No player type feature enabled")
25-
}
26-
}
27-
}
28-
}
29-
3017
#[derive(Debug, Deserialize, Clone)]
3118
#[cfg_attr(feature = "extras", derive(schemars::JsonSchema))]
3219
#[serde(default)]

src/script.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ pub enum ScriptInput {
2121
Struct(Script),
2222
}
2323

24-
#[derive(Debug, Deserialize, Clone, Copy, Eq, PartialEq)]
24+
#[derive(Debug, Default, Deserialize, Clone, Copy, Eq, PartialEq)]
2525
#[serde(rename_all = "snake_case")]
2626
#[cfg_attr(feature = "extras", derive(schemars::JsonSchema))]
2727
pub enum ScriptMode {
28+
#[default]
2829
Poll,
2930
Watch,
3031
}
@@ -48,12 +49,6 @@ impl From<&str> for ScriptMode {
4849
}
4950
}
5051

51-
impl Default for ScriptMode {
52-
fn default() -> Self {
53-
Self::Poll
54-
}
55-
}
56-
5752
impl Display for ScriptMode {
5853
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
5954
write!(

0 commit comments

Comments
 (0)