replace Error/ErroKind pair with just enum Error
This commit is contained in:
parent
71a97a9e4d
commit
b211d95807
23
src/error.rs
23
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),
|
||||
}
|
||||
|
|
Reference in a new issue