Skip to content

Commit e4e493d

Browse files
committed
fix: config defaults
1 parent 7e98769 commit e4e493d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/util.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,25 @@ pub fn load_config() -> (Config, PathBuf) {
5656

5757
#[derive(Serialize, Deserialize, Clone, Debug)]
5858
pub struct WindowConfig {
59+
#[serde(default)]
5960
process_name: String,
61+
#[serde(default)]
6062
window_class: String,
63+
#[serde(default)]
6164
transparency: u8,
65+
#[serde(default)]
6266
enabled: bool,
6367
}
64-
68+
impl Default for WindowConfig {
69+
fn default() -> Self {
70+
Self {
71+
process_name: String::new(),
72+
window_class: String::new(),
73+
transparency: 255,
74+
enabled: false,
75+
}
76+
}
77+
}
6578
impl From<&WindowConfig> for TransparencyRule {
6679
fn from(config: &WindowConfig) -> Self {
6780
TransparencyRule {

0 commit comments

Comments
 (0)