Skip to content

Commit 574e9b4

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

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

src/config/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,19 +224,15 @@ pub enum MonitorConfig {
224224
#[derive(Debug, Deserialize, Copy, Clone, PartialEq, Eq)]
225225
#[serde(rename_all = "snake_case")]
226226
#[cfg_attr(feature = "extras", derive(JsonSchema))]
227+
#[derive(Default)]
227228
pub enum BarPosition {
228229
Top,
230+
#[default]
229231
Bottom,
230232
Left,
231233
Right,
232234
}
233235

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

src/modules/music/config.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,15 @@ use std::path::PathBuf;
66
#[derive(Debug, Deserialize, Clone, Copy)]
77
#[serde(rename_all = "snake_case")]
88
#[cfg_attr(feature = "extras", derive(schemars::JsonSchema))]
9+
#[derive(Default)]
910
pub enum PlayerType {
1011
#[cfg(feature = "music+mpd")]
1112
Mpd,
1213
#[cfg(feature = "music+mpris")]
14+
#[default]
1315
Mpris,
1416
}
1517

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-
3018
#[derive(Debug, Deserialize, Clone)]
3119
#[cfg_attr(feature = "extras", derive(schemars::JsonSchema))]
3220
#[serde(default)]

src/script.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ pub enum ScriptInput {
2424
#[derive(Debug, Deserialize, Clone, Copy, Eq, PartialEq)]
2525
#[serde(rename_all = "snake_case")]
2626
#[cfg_attr(feature = "extras", derive(schemars::JsonSchema))]
27+
#[derive(Default)]
2728
pub enum ScriptMode {
29+
#[default]
2830
Poll,
2931
Watch,
3032
}
@@ -48,12 +50,6 @@ impl From<&str> for ScriptMode {
4850
}
4951
}
5052

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

0 commit comments

Comments
 (0)