#![cfg_attr(not(any(test, feature = "std")), no_std)]
#![cfg_attr(
not(test),
deny(
clippy::indexing_slicing,
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::exhaustive_structs,
clippy::exhaustive_enums,
missing_debug_implementations,
)
)]
#![warn(missing_docs)]
#![allow(unused_imports)] #![allow(deprecated)]
#![deprecated(since = "1.3.0", note = "this crate has been superseded by `ICU4X`'s `compiled_data` feature. Data for new components will not be added, and it will not be updated for `ICU4X` 2.0.")]
extern crate alloc;
#[path = "../data/metadata.rs.data"]
mod metadata;
#[deprecated(since = "1.3.0")]
pub mod versions {
#[deprecated(since = "1.3.0")]
pub fn cldr_tag() -> alloc::string::String {
alloc::string::String::from(super::metadata::CLDR_TAG)
}
#[deprecated(since = "1.3.0")]
pub fn icu_tag() -> alloc::string::String {
alloc::string::String::from(super::metadata::ICUEXPORT_TAG)
}
}
#[deprecated(since = "1.3.0")]
pub fn locales() -> alloc::vec::Vec<icu_locid::LanguageIdentifier> {
alloc::vec::Vec::from(metadata::LOCALES)
}
#[cfg(feature = "std")]
#[deprecated(since = "1.3.0")]
pub mod paths {
use std::path::PathBuf;
#[deprecated(since = "1.3.0")]
pub fn data_root() -> PathBuf {
PathBuf::from(std::env!("CARGO_MANIFEST_DIR")).join("data")
}
#[deprecated(since = "1.3.0")]
pub fn cldr_json_root() -> PathBuf {
data_root().join("cldr")
}
#[deprecated(since = "1.3.0")]
pub fn icuexport_toml_root() -> PathBuf {
data_root().join("icuexport")
}
#[deprecated(since = "1.3.0")]
pub fn coll_toml_root() -> PathBuf {
data_root().join("coll")
}
}
use icu_provider::prelude::*;
use icu_provider_adapters::fallback::LocaleFallbackProvider;
#[cfg(feature = "icu_locid_transform")]
#[deprecated(since = "1.3.0", note = "use `compiled_data`")]
pub fn unstable() -> LocaleFallbackProvider<UnstableDataProvider> {
#[allow(clippy::unwrap_used)]
LocaleFallbackProvider::try_new_unstable(unstable_no_fallback()).unwrap()
}
#[deprecated(since = "1.3.0", note = "use `compiled_data`")]
pub fn unstable_no_fallback() -> UnstableDataProvider {
UnstableDataProvider
}
#[cfg(feature = "icu_locid_transform")]
#[deprecated(since = "1.3.0", note = "use `compiled_data`")]
pub fn any() -> impl AnyProvider {
#[allow(clippy::unwrap_used)]
LocaleFallbackProvider::try_new_with_any_provider(any_no_fallback()).unwrap()
}
#[deprecated(since = "1.3.0", note = "use `compiled_data`")]
pub fn any_no_fallback() -> impl AnyProvider {
UnstableDataProvider
}
#[cfg(feature = "buffer")]
#[deprecated(since = "1.3.0", note = "use `compiled_data`")]
pub fn buffer() -> impl BufferProvider {
#[allow(clippy::unwrap_used)]
LocaleFallbackProvider::try_new_with_buffer_provider(buffer_no_fallback()).unwrap()
}
#[cfg(feature = "buffer")]
#[deprecated(since = "1.3.0", note = "use `compiled_data`")]
pub fn buffer_no_fallback() -> impl BufferProvider {
#[allow(clippy::unwrap_used)] icu_provider_blob::BlobDataProvider::try_new_from_static_blob(include_bytes!(
"../data/testdata.postcard"
))
.unwrap()
}
#[doc(hidden)]
#[non_exhaustive]
#[derive(Debug)]
#[deprecated(since = "1.3.0", note = "use `compiled_data`")]
pub struct UnstableDataProvider;
mod baked {
include!("../data/baked/mod.rs");
impl_data_provider!(super::UnstableDataProvider);
impl_any_provider!(super::UnstableDataProvider);
}