From 5aa22de68e43a7f9efb7ddba89a98d5034ee49bc Mon Sep 17 00:00:00 2001 From: kyren Date: Tue, 20 Mar 2018 14:07:32 -0400 Subject: [PATCH] Use git dependency on failure 1.0 for right now --- Cargo.toml | 2 +- src/error.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a3f4b83..2a7fcc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ builtin-lua = ["cc"] [dependencies] libc = { version = "0.2" } -failure = { version = "0.1.1" } +failure = { git = "https://github.com/rust-lang-nursery/failure", version = "1.0" } compiletest_rs = { version = "0.3", optional = true } [build-dependencies] diff --git a/src/error.rs b/src/error.rs index fbb6a1d..cd0882f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -185,9 +185,7 @@ impl failure::Fail for Error { fn cause(&self) -> Option<&failure::Fail> { match *self { Error::CallbackError { ref cause, .. } => Some(cause.as_ref()), - // Error::cause simply returns the contained Fail type, which we are already displaying - // and returning the backtrace for, no need to repeat it as the cause. - Error::ExternalError(ref err) => err.cause().cause(), + Error::ExternalError(ref err) => err.as_fail().cause(), _ => None, } }