diff options
-rw-r--r-- | ffi/src/error.rs | 4 | ||||
-rw-r--r-- | openpgp-ffi/src/error.rs | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/ffi/src/error.rs b/ffi/src/error.rs index 7ca484d1..0eff9226 100644 --- a/ffi/src/error.rs +++ b/ffi/src/error.rs @@ -79,7 +79,9 @@ impl<'a> FromSequoiaError<'a> for Status { Status::InvalidKey, &openpgp::Error::PolicyViolation(_, _) => Status::PolicyViolation, - &_ => unreachable!(), // openpgp::Error is non-exhaustive. + // openpgp::Error is non_exhaustive, match on &_ to handle + // future additions. + &_ => Status::UnknownError } } diff --git a/openpgp-ffi/src/error.rs b/openpgp-ffi/src/error.rs index 3bfa0f5c..c03855ae 100644 --- a/openpgp-ffi/src/error.rs +++ b/openpgp-ffi/src/error.rs @@ -267,7 +267,9 @@ impl<'a> From<&'a anyhow::Error> for Status { Status::InvalidKey, &openpgp::Error::PolicyViolation(_, _) => Status::PolicyViolation, - &_ => unreachable!(), // openpgp::Error is non-exhaustive. + // openpgp::Error is non_exhaustive, match on &_ to handle + // future additions. + &_ => Status::UnknownError } } |