diff options
| author | Teddy Wing | 2018-10-23 06:56:08 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-10-23 06:56:08 +0200 |
| commit | adc4a2f7a84967541d9da3c2f8edb2814a59ab59 (patch) | |
| tree | 3c8a1afccbae5b2ea993912745733b5e7cf80f4a /src/lib.rs | |
| parent | aaca041a3eb0938ca00314aeb0ca1799d3804ba5 (diff) | |
| download | dome-key-map-adc4a2f7a84967541d9da3c2f8edb2814a59ab59.tar.bz2 | |
trial: Implement `do_trial()`
This function serves as the entry point to all trial functionality. When
called, it will try to determine the number of days remaining in the
trial.
* If the trial period is in progress, the number of days remaining will
be printed.
* If an error is encountered involving the trial file, or the trial has
expired, an error message is printed and the program exits.
* Finally, if an unrelated error occurs, print the error without
exiting.
Change `DateTime<Local>`s to `DateTime<FixedOffset>`s in order to have
uniform date types. Otherwise we run into trouble when comparing dates
and when querying functions with different date typs.
TODO: This fails the tests (unless your local timezone is UTC
presumably) because the local time gets stripped of its offset and the
correct offset gets reapplied, incorrectly shifting the time. Figure out
a way to have uniform datetime types without muffing up the timezone
offsets.
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -10,6 +10,7 @@ extern crate core_graphics; #[macro_use] extern crate error_chain; +extern crate exitcode; extern crate foreign_types; extern crate getopts; extern crate libc; |
