From bb6956740d8a063b84de96f5c462a782551e7740 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 3 Sep 2017 15:10:58 +0200 Subject: [PATCH] libimagentrymarkdown: Rewrite error handling --- lib/entry/libimagentrymarkdown/src/error.rs | 9 +++++---- lib/entry/libimagentrymarkdown/src/lib.rs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/entry/libimagentrymarkdown/src/error.rs b/lib/entry/libimagentrymarkdown/src/error.rs index b3956d0e..60e9348e 100644 --- a/lib/entry/libimagentrymarkdown/src/error.rs +++ b/lib/entry/libimagentrymarkdown/src/error.rs @@ -17,6 +17,10 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +use std::error::Error; + +use libimagerror::into::IntoError; + error_chain! { types { MarkdownError, MarkdownErrorKind, ResultExt, Result; @@ -36,9 +40,6 @@ error_chain! { } } -pub use self::error::MarkdownError; -pub use self::error::MarkdownErrorKind; - impl IntoError for MarkdownErrorKind { type Target = MarkdownError; @@ -47,7 +48,7 @@ impl IntoError for MarkdownErrorKind { MarkdownError::from_kind(self) } - fn into_error_with_cause(self, cause: Box) -> Self::Target { + fn into_error_with_cause(self, _: Box) -> Self::Target { MarkdownError::from_kind(self) } } diff --git a/lib/entry/libimagentrymarkdown/src/lib.rs b/lib/entry/libimagentrymarkdown/src/lib.rs index 44bc6d35..fd00ee80 100644 --- a/lib/entry/libimagentrymarkdown/src/lib.rs +++ b/lib/entry/libimagentrymarkdown/src/lib.rs @@ -38,7 +38,7 @@ extern crate hoedown; extern crate url; extern crate libimagstore; -#[macro_use] extern crate libimagerror; +extern crate libimagerror; #[macro_use] extern crate error_chain; pub mod error;