Remove {Pre, Post}HookErrorKind types as they are not needed anymore

This commit is contained in:
Matthias Beyer 2016-03-04 21:41:04 +01:00
parent 987b271cc7
commit 9e8ef57f72

View file

@ -11,30 +11,6 @@ use std::convert::Into;
pub enum HookErrorKind {
HookExecutionError,
AccessTypeViolation,
Pre(PreHookErrorKind),
Post(PostHookErrorKind)
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum PreHookErrorKind {
// ...
}
impl Into<HookErrorKind> for PreHookErrorKind {
fn into(self) -> HookErrorKind {
HookErrorKind::Pre(self)
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum PostHookErrorKind {
// ...
}
impl Into<HookErrorKind> for PostHookErrorKind {
fn into(self) -> HookErrorKind {
HookErrorKind::Post(self)
}
}
pub trait IntoHookError {
@ -58,38 +34,6 @@ impl Into<HookError> for (HookErrorKind, Box<Error>) {
}
impl Into<HookError> for PreHookErrorKind {
fn into(self) -> HookError {
HookError::new(HookErrorKind::Pre(self), None)
}
}
impl Into<HookError> for (PreHookErrorKind, Box<Error>) {
fn into(self) -> HookError {
HookError::new(HookErrorKind::Pre(self.0), Some(self.1))
}
}
impl Into<HookError> for PostHookErrorKind {
fn into(self) -> HookError {
HookError::new(HookErrorKind::Post(self), None)
}
}
impl Into<HookError> for (PostHookErrorKind, Box<Error>) {
fn into(self) -> HookError {
HookError::new(HookErrorKind::Post(self.0), Some(self.1))
}
}
fn hook_error_type_as_str(e: &HookErrorKind) -> &'static str {
match e {
_ => "",