add File
Ext2
test
This commit is contained in:
parent
55b23f4974
commit
a8199f00d0
14
src/error.rs
14
src/error.rs
|
@ -1,9 +1,14 @@
|
|||
#[cfg(any(test, not(feature = "no_std")))]
|
||||
use std::io;
|
||||
|
||||
/// The set of all possible errors
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
BadMagic(u16),
|
||||
OutOfBounds(usize),
|
||||
BadBlockGroupCount(u32, u32),
|
||||
#[cfg(any(test, not(feature = "no_std")))]
|
||||
Io(io::Error),
|
||||
}
|
||||
|
||||
impl From<Infallible> for Error {
|
||||
|
@ -12,4 +17,11 @@ impl From<Infallible> for Error {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(test, not(feature = "no_std")))]
|
||||
impl From<io::Error> for Error {
|
||||
fn from(err: io::Error) -> Error {
|
||||
Error::Io(err)
|
||||
}
|
||||
}
|
||||
|
||||
pub enum Infallible {}
|
||||
|
|
Reference in a new issue