use core::fmt::{self, Display, Formatter};
#[cfg(feature = "std")]
use std::error::Error;
#[derive(Debug, Clone)]
pub enum Base64Error {
Invalid,
PaddingMust,
PaddingDisallow,
}
impl Display for Base64Error {
#[inline]
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
match self {
Self::Invalid => f.write_str("invalid Base64"),
Self::PaddingMust => f.write_str("padding not found"),
Self::PaddingDisallow => f.write_str("padding not allowed"),
}
}
}
#[cfg(feature = "std")]
impl Error for Base64Error {}