Skip to content

Commit

Permalink
feat(error): add private __Nonexhaustive variant to Error
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Adds a new variant to public Error enum. The proper fix
  is to stop matching exhaustively on `hyper::Error`.
  • Loading branch information
seanmonstar committed Jun 2, 2015
1 parent 486a219 commit 7c0421e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/error.rs
Expand Up @@ -45,6 +45,18 @@ pub enum Error {
Ssl(SslError),
/// An HTTP/2-specific error, coming from the `solicit` library.
Http2(Http2Error),

#[doc(hidden)]
__Nonexhaustive(Void)
}

#[doc(hidden)]
pub enum Void {}

impl fmt::Debug for Void {
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}

impl fmt::Display for Error {
Expand All @@ -65,6 +77,7 @@ impl StdError for Error {
Io(ref e) => e.description(),
Ssl(ref e) => e.description(),
Http2(ref e) => e.description(),
Error::__Nonexhaustive(ref void) => match *void {}
}
}

Expand Down

0 comments on commit 7c0421e

Please sign in to comment.