#![cfg_attr(
not(test),
deny(
clippy::indexing_slicing,
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::exhaustive_structs,
clippy::exhaustive_enums,
// TODO(#2266): enable missing_debug_implementations,
)
)]
#[cfg(test)]
pub mod testing;
pub mod pluralrules;
pub mod list;
#[derive(Debug, Hash, Clone, PartialEq)]
pub struct DataLocale(icu_provider::DataLocale);
impl DataLocale {
fn from_ecma_locale<L: ecma402_traits::Locale>(other: L) -> Self {
#[allow(clippy::unwrap_used)] Self(
other
.to_string()
.parse::<icu::locid::Locale>()
.unwrap()
.into(),
)
}
}
impl core::ops::Deref for DataLocale {
type Target = icu_provider::DataLocale;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl ecma402_traits::Locale for crate::DataLocale {}
impl std::fmt::Display for crate::DataLocale {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
pub(crate) struct GlobalDataProvider;
mod baked {
include!(concat!(env!("OUT_DIR"), "/baked/mod.rs"));
impl_data_provider!(super::GlobalDataProvider);
}