config: Refactor WorkspaceLayout to use the Default macro
This commit is contained in:
parent
2b8a3f7894
commit
fec4b3c235
1 changed files with 3 additions and 6 deletions
|
|
@ -2,14 +2,10 @@
|
|||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
fn default_workspace_layout() -> WorkspaceLayout {
|
||||
WorkspaceLayout::Vertical
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct WorkspaceConfig {
|
||||
pub workspace_mode: WorkspaceMode,
|
||||
#[serde(default = "default_workspace_layout")]
|
||||
#[serde(default)]
|
||||
pub workspace_layout: WorkspaceLayout,
|
||||
}
|
||||
|
||||
|
|
@ -28,8 +24,9 @@ pub enum WorkspaceMode {
|
|||
Global,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum WorkspaceLayout {
|
||||
#[default]
|
||||
Vertical,
|
||||
Horizontal,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue