aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/asset/chain/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_core/src/asset/chain/error.rs')
-rw-r--r--mingling_core/src/asset/chain/error.rs22
1 files changed, 10 insertions, 12 deletions
diff --git a/mingling_core/src/asset/chain/error.rs b/mingling_core/src/asset/chain/error.rs
index ad64195..bb5f679 100644
--- a/mingling_core/src/asset/chain/error.rs
+++ b/mingling_core/src/asset/chain/error.rs
@@ -13,8 +13,8 @@ pub enum ChainProcessError {
impl std::fmt::Display for ChainProcessError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
- ChainProcessError::Other(s) => write!(f, "Other error: {s}"),
- ChainProcessError::IO(e) => write!(f, "IO error: {e}"),
+ Self::Other(s) => write!(f, "Other error: {s}"),
+ Self::IO(e) => write!(f, "IO error: {e}"),
}
}
}
@@ -22,15 +22,15 @@ impl std::fmt::Display for ChainProcessError {
impl std::error::Error for ChainProcessError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
- ChainProcessError::IO(e) => Some(e),
- ChainProcessError::Other(_) => None,
+ Self::IO(e) => Some(e),
+ Self::Other(_) => None,
}
}
}
impl From<std::io::Error> for ChainProcessError {
fn from(e: std::io::Error) -> Self {
- ChainProcessError::IO(e)
+ Self::IO(e)
}
}
@@ -38,17 +38,15 @@ impl From<ProgramInternalExecuteError> for ChainProcessError {
fn from(value: ProgramInternalExecuteError) -> Self {
match value {
ProgramInternalExecuteError::DispatcherNotFound => {
- ChainProcessError::Other("DispatcherNotFound".into())
+ Self::Other("DispatcherNotFound".into())
}
ProgramInternalExecuteError::RendererNotFound(r) => {
- ChainProcessError::Other(format!("RendererNotFound: {r}"))
- }
- ProgramInternalExecuteError::Other(e) => ChainProcessError::Other(e),
- ProgramInternalExecuteError::IO(e) => {
- ChainProcessError::Other(format!("IOError: {e:?}"))
+ Self::Other(format!("RendererNotFound: {r}"))
}
+ ProgramInternalExecuteError::Other(e) => Self::Other(e),
+ ProgramInternalExecuteError::IO(e) => Self::Other(format!("IOError: {e:?}")),
ProgramInternalExecuteError::REPLPanic(program_panic) => {
- ChainProcessError::Other(format!("REPLPanic: {program_panic}"))
+ Self::Other(format!("REPLPanic: {program_panic}"))
}
}
}