1// This file is part of ICU4X. For terms of use, please see the file
2// called LICENSE at the top level of the ICU4X source tree
3// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5use core::fmt::Debug;
6use displaydoc::Display;
7use icu_provider::DataError;
8
9#[cfg(feature = "std")]
10impl std::error::Error for LocaleTransformError {}
11
12/// A list of error outcomes for various operations in this module.
13///
14/// Re-exported as [`Error`](crate::Error).
15#[derive(Display, Debug, Copy, Clone, PartialEq)]
16#[non_exhaustive]
17pub enum LocaleTransformError {
18 /// An error originating inside of the [data provider](icu_provider).
19 #[displaydoc("{0}")]
20 Data(DataError),
21}
22
23impl From<DataError> for LocaleTransformError {
24 fn from(e: DataError) -> Self {
25 Self::Data(e)
26 }
27}
28