diff options
| author | Teddy Wing | 2018-10-21 19:51:48 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-10-21 19:51:48 +0200 |
| commit | ff244b2e9b7705534ea37ff727be205274ea9ae3 (patch) | |
| tree | a340238898ee00150c8100ecb9640f957ecfd7fb /src/lib.rs | |
| parent | 6b0f1121662e5e9ca968c554bb7a19f6fd5566c9 (diff) | |
| download | dome-key-map-ff244b2e9b7705534ea37ff727be205274ea9ae3.tar.bz2 | |
Add `trial` module, calculate days remaining
This new module will contain functions to calculate trial days.
Here we implement a function to calculate the days remaining in a trial
period.
If there are less than 0 days remaining, it returns an error result.
Couldn't use 'error-chain' because it was complaining about `Debug` and
`PartialEq` not being defined. Don't know if it's possible to implement
those traits on 'error-chain''s ErrorKind`, but it was complicated
enough that I ended up not bothering. Went with 'quick_error' instead to
create a custom error type without having to `impl` all the required
traits.
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1,6 +1,7 @@ #![recursion_limit="128"] extern crate autopilot; +extern crate chrono; extern crate cocoa; #[macro_use] @@ -20,6 +21,9 @@ extern crate log; extern crate objc; #[macro_use] +extern crate quick_error; + +#[macro_use] extern crate serde_derive; extern crate stderrlog; extern crate toml; @@ -31,6 +35,7 @@ mod config; mod errors; mod key_code; mod parser; +mod trial; use parser::{Action, HeadphoneButton, MapAction, MapGroup, MapKind}; |
