From 0a171ed301b056ceb0547c93121feb183e4eedf9 Mon Sep 17 00:00:00 2001 From: Andrii Radyk Date: Sat, 21 Dec 2019 16:20:52 +0100 Subject: [PATCH] remove deprecated Error::description and cause --- src/lib.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0c78c0d..7178a08 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -126,27 +126,7 @@ pub enum Error { __Nonexhaustive, } -impl error::Error for Error { - fn description(&self) -> &str { - match *self { - Error::EnvNoPkgConfig(_) => "pkg-config requested to be aborted", - Error::CrossCompilation => { - "pkg-config doesn't handle cross compilation. \ - Use PKG_CONFIG_ALLOW_CROSS=1 to override" - } - Error::Command { .. } => "failed to run pkg-config", - Error::Failure { .. } => "pkg-config did not exit sucessfully", - Error::__Nonexhaustive => panic!(), - } - } - - fn cause(&self) -> Option<&dyn error::Error> { - match *self { - Error::Command { ref cause, .. } => Some(cause), - _ => None, - } - } -} +impl error::Error for Error {} impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {