use core::{error::Error, fmt};
use super::ReserveError;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ToLeanStrError {
Reserve(ReserveError),
Fmt(fmt::Error),
}
impl Error for ToLeanStrError {}
impl fmt::Display for ToLeanStrError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ToLeanStrError::Reserve(e) => e.fmt(f),
ToLeanStrError::Fmt(e) => e.fmt(f),
}
}
}
impl From<ReserveError> for ToLeanStrError {
fn from(value: ReserveError) -> Self {
ToLeanStrError::Reserve(value)
}
}
impl From<fmt::Error> for ToLeanStrError {
fn from(value: fmt::Error) -> Self {
ToLeanStrError::Fmt(value)
}
}