libimagentrymarkdown: Rewrite error handling

This commit is contained in:
Matthias Beyer 2017-09-03 15:10:58 +02:00
parent 9aa5d7439d
commit bb6956740d
2 changed files with 6 additions and 5 deletions

View file

@ -17,6 +17,10 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// //
use std::error::Error;
use libimagerror::into::IntoError;
error_chain! { error_chain! {
types { types {
MarkdownError, MarkdownErrorKind, ResultExt, Result; MarkdownError, MarkdownErrorKind, ResultExt, Result;
@ -36,9 +40,6 @@ error_chain! {
} }
} }
pub use self::error::MarkdownError;
pub use self::error::MarkdownErrorKind;
impl IntoError for MarkdownErrorKind { impl IntoError for MarkdownErrorKind {
type Target = MarkdownError; type Target = MarkdownError;
@ -47,7 +48,7 @@ impl IntoError for MarkdownErrorKind {
MarkdownError::from_kind(self) MarkdownError::from_kind(self)
} }
fn into_error_with_cause(self, cause: Box<Error>) -> Self::Target { fn into_error_with_cause(self, _: Box<Error>) -> Self::Target {
MarkdownError::from_kind(self) MarkdownError::from_kind(self)
} }
} }

View file

@ -38,7 +38,7 @@
extern crate hoedown; extern crate hoedown;
extern crate url; extern crate url;
extern crate libimagstore; extern crate libimagstore;
#[macro_use] extern crate libimagerror; extern crate libimagerror;
#[macro_use] extern crate error_chain; #[macro_use] extern crate error_chain;
pub mod error; pub mod error;