replace Error/ErroKind pair with just enum Error

This commit is contained in:
Szymon Walter 2018-03-18 18:34:26 +01:00
parent 71a97a9e4d
commit b211d95807

View file

@ -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 /// The set of all possible errors
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum ErrorKind { pub enum Error {
BadMagic, BadMagic(u16),
OutOfBounds, OutOfBounds(usize),
BadBlockGroupCount(u32, u32),
} }