cgp-error-std 0.5.0-beta2

Context-generic programming error handlers implemented using `std::error::Error`
Documentation
use alloc::string::String;
use core::error::Error;
use core::fmt::{Debug, Display};

pub struct StringError {
    pub message: String,
}

impl From<String> for StringError {
    fn from(message: String) -> Self {
        Self { message }
    }
}

impl Debug for StringError {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        Display::fmt(&self.message, f)
    }
}

impl Display for StringError {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        Display::fmt(&self.message, f)
    }
}

impl Error for StringError {}