From 817d07c081642a39755a417beee439726549bf15 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Sat, 29 Feb 2020 17:11:47 -0800 Subject: [PATCH] Use non_exhaustive on sqlx::Error --- sqlx-core/src/error.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sqlx-core/src/error.rs b/sqlx-core/src/error.rs index 9269d6a3..eea04b09 100644 --- a/sqlx-core/src/error.rs +++ b/sqlx-core/src/error.rs @@ -10,6 +10,7 @@ pub type Result = std::result::Result; /// A generic error that represents all the ways a method can fail inside of SQLx. #[derive(Debug)] +#[non_exhaustive] pub enum Error { /// Error communicating with the database. Io(io::Error), @@ -54,10 +55,6 @@ pub enum Error { TlsUpgrade(Box), Decode(DecodeError), - - // TODO: Remove and replace with `#[non_exhaustive]` when possible - #[doc(hidden)] - __Nonexhaustive, } impl StdError for Error { @@ -118,8 +115,6 @@ impl Display for Error { Error::PoolClosed => f.write_str("attempted to acquire a connection on a closed pool"), Error::TlsUpgrade(ref err) => write!(f, "error during TLS upgrade: {}", err), - - Error::__Nonexhaustive => unreachable!(), } } }