diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.rs | 15 | ||||
| -rw-r--r-- | src/lib.rs | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs index 6ee2d17..22f37b6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,5 +1,7 @@ use getopts::Options; +type Milliseconds = u16; + #[repr(C)] #[derive(Default)] struct Args { @@ -8,9 +10,20 @@ struct Args { } #[repr(C)] -#[derive(Default)] +#[derive(Deserialize)] pub struct Config { + #[serde(skip)] args: Args, + timeout: Milliseconds, +} + +impl Default for Config { + fn default() -> Self { + Config { + args: Args::default(), + timeout: 500, + } + } } fn print_usage(opts: Options) { @@ -15,6 +15,9 @@ extern crate log; #[macro_use] extern crate objc; + +#[macro_use] +extern crate serde_derive; extern crate stderrlog; extern crate xdg; |
