From b211d958079e55dedc90391162f8f0952988cf27 Mon Sep 17 00:00:00 2001 From: Szymon Walter Date: Sun, 18 Mar 2018 18:34:26 +0100 Subject: [PATCH] replace Error/ErroKind pair with just `enum Error` --- src/error.rs | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/error.rs b/src/error.rs index a7caea7..d6aee4f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,22 +1,7 @@ -/// Wrapper around the raw `ErrorKind` -#[derive(Clone, Debug, PartialEq, Eq, Hash)] -pub struct Error { - kind: ErrorKind, -} - -impl Error { - pub fn from_kind(kind: ErrorKind) -> Error { - Error { kind } - } - - pub fn kind(&self) -> ErrorKind { - self.kind - } -} - /// The set of all possible errors #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] -pub enum ErrorKind { - BadMagic, - OutOfBounds, +pub enum Error { + BadMagic(u16), + OutOfBounds(usize), + BadBlockGroupCount(u32, u32), }