diff options
| author | Teddy Wing | 2018-10-23 15:40:38 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-10-23 15:40:38 +0200 | 
| commit | b419ee9c6809d1e4081c885380fbf8c8103dad49 (patch) | |
| tree | 48ced8f26949f93645281d95dca22c710f965e11 /src/errors.rs | |
| parent | 8369a753e24e1e2d986e9988793655f8923e182c (diff) | |
| download | dome-key-map-b419ee9c6809d1e4081c885380fbf8c8103dad49.tar.bz2 | |
do_trial(): Fix unreachable `DurationError` patterns
I was getting these warnings:
    warning: unreachable pattern
      --> src/trial.rs:41:17
       |
    40 |                 DurationError => return trial_expired(),
       |                 ------------- matches any value
    41 |                 e => {
       |                 ^ unreachable pattern
    warning: unreachable pattern
      --> src/trial.rs:55:9
       |
    54 |         DurationError => trial_expired(),
       |         ------------- matches any value
    55 |         Err(e) => (),
       |         ^^^^^^ unreachable pattern
Wasn't correctly matching the `DurationError`s.
Add an 'error-chain' `ErrorKind` for `DurationError` to make it the same
type as the others matched in the first `match` pattern.
Diffstat (limited to 'src/errors.rs')
| -rw-r--r-- | src/errors.rs | 1 | 
1 files changed, 1 insertions, 0 deletions
| diff --git a/src/errors.rs b/src/errors.rs index f84bb2e..75079e3 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -8,6 +8,7 @@ error_chain! {          Io(::std::io::Error);          DateCrypt(DateCryptError); +        Duration(DurationError);      }  } | 
