diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-01-02 11:59:14 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-01-02 13:32:02 +0100 |
commit | 984d3645cbb68437475316fda35a2726f5cc21c1 (patch) | |
tree | 1708bae47a103e08e50251eaaef7b57ca61b9062 /openpgp | |
parent | 75c1d18d7a7eb3e6889c651cfaf8e6c4da00b647 (diff) |
openpgp: Mark enum Error non-exhaustive.
- See #405.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs index a351c789..56d88528 100644 --- a/openpgp/src/lib.rs +++ b/openpgp/src/lib.rs @@ -167,6 +167,9 @@ pub type Result<T> = ::std::result::Result<T, failure::Error>; #[derive(Fail, Debug, Clone)] /// Errors returned by this module. +/// +/// Note: This enum cannot be exhaustively matched to allow future +/// extensions. pub enum Error { /// Invalid argument. #[fail(display = "Invalid argument: {}", _0)] @@ -268,6 +271,10 @@ pub enum Error { /// Not yet live. #[fail(display = "Not live until {:?}", _0)] NotYetLive(std::time::SystemTime), + + /// This marks this enum as non-exhaustive. Do not use this + /// variant. + #[doc(hidden)] #[fail(display = "__Nonexhaustive")] __Nonexhaustive, } /// The OpenPGP packets that Sequoia understands. |