feat(config): add structure

chore(deps): add serde+derive and toml
This commit is contained in:
Dmitriy Pleshevskiy 2022-02-18 23:01:47 +03:00
parent 02c9af6574
commit 8db3ab3c12
3 changed files with 24 additions and 2 deletions

View File

@ -16,7 +16,8 @@ name = "hwt"
path = "src/main.rs"
[dependencies]
druid = "0.7.0"
log = "0.4.14"
druid = "0.7.0"
rodio = "0.15.0"
serde = { version = "1.0.136", features = ["derive"] }
toml = "0.5.8"

20
src/config.rs Normal file
View File

@ -0,0 +1,20 @@
use serde::Deserialize;
#[derive(Deserialize)]
pub struct Env {
pub micro_timer: BreakTimer,
pub rest_timer: BreakTimer,
pub notifier: Notifier,
}
#[derive(Deserialize)]
pub struct BreakTimer {
pub duration: f64,
pub postpone_duration: f64,
pub rest_duration: f64,
}
#[derive(Deserialize)]
pub struct Notifier {
pub duration: f64,
}

View File

@ -1,5 +1,6 @@
mod cmd;
mod comp;
mod config;
mod delegate;
mod env;
mod sound;