summaryrefslogtreecommitdiffstats
path: root/openpgp/src/lib.rs
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2020-09-22 00:45:53 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2020-11-06 09:46:53 +0100
commitcdc9e16fb2aef0156d6af4abe3e519c22efa230e (patch)
treef4f5e10029ed7816bcb0931c53d27ed0e21c598c /openpgp/src/lib.rs
parent327a987e2c95ea9d05fcadd6fa7a8c249372affd (diff)
openpgp: Use non_exhaustive attribute.
- Fixes #563 - With an MSRV >= 1.40.0, we can use #[non_exhaustive], as mentioned in #406. - This is also a clippy lint: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
Diffstat (limited to 'openpgp/src/lib.rs')
-rw-r--r--openpgp/src/lib.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs
index d71bb483..bb143d2f 100644
--- a/openpgp/src/lib.rs
+++ b/openpgp/src/lib.rs
@@ -177,6 +177,7 @@ pub type Result<T> = ::std::result::Result<T, anyhow::Error>;
///
/// Note: This enum cannot be exhaustively matched to allow future
/// extensions.
+#[non_exhaustive]
#[derive(thiserror::Error, Debug, Clone, PartialEq, Eq)]
pub enum Error {
/// Invalid argument.
@@ -296,8 +297,4 @@ pub enum Error {
.1.as_ref().map(|t| format!(" since {}", crate::fmt::time(t)))
.unwrap_or("".into()))]
PolicyViolation(String, Option<std::time::SystemTime>),
-
- /// This marks this enum as non-exhaustive. Do not use this
- /// variant.
- #[doc(hidden)] #[error("__Nonexhaustive")] __Nonexhaustive,
}