Use StorageError::CustomError for implementations-specific (I/O) errors
This commit is contained in:
@@ -34,17 +34,12 @@ pub enum StorageError {
|
|||||||
|
|
||||||
/// Implementation-specific error.
|
/// Implementation-specific error.
|
||||||
CustomError,
|
CustomError,
|
||||||
|
|
||||||
// I/O error
|
|
||||||
#[cfg(feature = "hostenv")]
|
|
||||||
IOError,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "hostenv")]
|
#[cfg(feature = "std")]
|
||||||
#[allow(unused_variables)]
|
|
||||||
impl From<std::io::Error> for StorageError {
|
impl From<std::io::Error> for StorageError {
|
||||||
fn from(error: std::io::Error) -> Self {
|
fn from(_: std::io::Error) -> Self {
|
||||||
Self::IOError
|
Self::CustomError
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ impl From<StorageError> for StoreError {
|
|||||||
fn from(error: StorageError) -> StoreError {
|
fn from(error: StorageError) -> StoreError {
|
||||||
match error {
|
match error {
|
||||||
StorageError::CustomError => StoreError::StorageError,
|
StorageError::CustomError => StoreError::StorageError,
|
||||||
#[cfg(feature = "hostenv")]
|
|
||||||
StorageError::IOError => StoreError::StorageError,
|
|
||||||
// The store always calls the storage correctly.
|
// The store always calls the storage correctly.
|
||||||
StorageError::NotAligned | StorageError::OutOfBounds => unreachable!(),
|
StorageError::NotAligned | StorageError::OutOfBounds => unreachable!(),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user