mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 12:38:04 +00:00
use snafu in core
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
use core::fmt::{self, Debug, Display};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct DisplayError<T>(pub T);
|
||||
|
||||
impl<T> Debug for DisplayError<T>
|
||||
where
|
||||
T: Debug,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Display for DisplayError<T>
|
||||
where
|
||||
T: Display,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> snafu::Error for DisplayError<T> where T: Display + Debug {}
|
||||
Reference in New Issue
Block a user