use icu_provider::{DataError, DataErrorKind};
pub(crate) const MISSING_CLDR_ERROR: DataError =
DataErrorKind::MissingSourceData.with_str_context("cldr");
pub(crate) const MISSING_ICUEXPORT_ERROR: DataError =
DataErrorKind::MissingSourceData.with_str_context("icuexport");
pub fn is_missing_cldr_error(mut e: DataError) -> bool {
e.key = None;
e == MISSING_CLDR_ERROR
}
pub fn is_missing_icuexport_error(mut e: DataError) -> bool {
e.key = None;
e == MISSING_ICUEXPORT_ERROR
}
pub(crate) fn data_error_from_toml(other: toml::de::Error) -> DataError {
DataError::custom("Toml deserialize").with_display_context(&other)
}