Skip to content

Commit

Permalink
Merge pull request #101 from AnderEnder/remove-deprecated-error-descr…
Browse files Browse the repository at this point in the history
…iption-cause

Remove deprecated Error::description and Error::cause
  • Loading branch information
sdroege authored Dec 22, 2019
2 parents 96e55cf + 0a171ed commit ef356f3
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit ef356f3

Please sign in to comment.