1use displaydoc::Display;
8use icu_properties::PropertiesError;
9use icu_provider::DataError;
10
11#[derive(Display, Debug)]
15#[non_exhaustive]
16pub enum NormalizerError {
17    #[displaydoc("{0}")]
19    Data(DataError),
20    FutureExtension,
22    ValidationError,
24}
25
26#[cfg(feature = "std")]
27impl std::error::Error for NormalizerError {}
28
29impl From<DataError> for NormalizerError {
30    fn from(e: DataError) -> Self {
31        NormalizerError::Data(e)
32    }
33}
34
35impl From<PropertiesError> for NormalizerError {
36    fn from(e: PropertiesError) -> Self {
37        match e {
38            PropertiesError::PropDataLoad(d) => NormalizerError::Data(d),
39            _ => unreachable!("Shouldn't have non-Data PropertiesError"),
40        }
41    }
42}