Skip to content

Commit fec4b3c

Browse files
it-a-meDrakulix
authored andcommitted
config: Refactor WorkspaceLayout to use the Default macro
1 parent 2b8a3f7 commit fec4b3c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cosmic-comp-config/src/workspace.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22

33
use serde::{Deserialize, Serialize};
44

5-
fn default_workspace_layout() -> WorkspaceLayout {
6-
WorkspaceLayout::Vertical
7-
}
8-
95
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
106
pub struct WorkspaceConfig {
117
pub workspace_mode: WorkspaceMode,
12-
#[serde(default = "default_workspace_layout")]
8+
#[serde(default)]
139
pub workspace_layout: WorkspaceLayout,
1410
}
1511

@@ -28,8 +24,9 @@ pub enum WorkspaceMode {
2824
Global,
2925
}
3026

31-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
27+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
3228
pub enum WorkspaceLayout {
29+
#[default]
3330
Vertical,
3431
Horizontal,
3532
}

0 commit comments

Comments
 (0)