use displaydoc::Display;
use icu_properties::PropertiesError;
use icu_provider::DataError;
#[derive(Display, Debug)]
#[non_exhaustive]
pub enum NormalizerError {
#[displaydoc("{0}")]
Data(DataError),
FutureExtension,
ValidationError,
}
#[cfg(feature = "std")]
impl std::error::Error for NormalizerError {}
impl From<DataError> for NormalizerError {
fn from(e: DataError) -> Self {
NormalizerError::Data(e)
}
}
impl From<PropertiesError> for NormalizerError {
fn from(e: PropertiesError) -> Self {
match e {
PropertiesError::PropDataLoad(d) => NormalizerError::Data(d),
_ => unreachable!("Shouldn't have non-Data PropertiesError"),
}
}
}