// @generated /// Implement `DataProvider` on the given struct using the data /// hardcoded in this file. This allows the struct to be used with /// `icu`'s `_unstable` constructors. #[doc(hidden)] #[macro_export] macro_rules! __impl_plurals_ranges_v1 { ($ provider : ty) => { #[clippy::msrv = "1.67"] const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; #[clippy::msrv = "1.67"] impl icu_provider::DataProvider for $provider { fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { static RO: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"B") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x04") }) }, }; static FA: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\"") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0") }) }, }; static LV: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01\x11!") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0\0") }) }, }; static KA: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02 ") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\x02") }) }, }; static AF: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0") }) }, }; static MK: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\"") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0") }) }, }; static SL: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\"2B") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x04\x04\x04\x04") }) }, }; static HE: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\x03#") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0\0") }) }, }; static AR: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\x03\x12\x13#") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0\x01\x01\0") }) }, }; static UND: ::Yokeable = icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(zerovec::ZeroVec::new(), zerovec::ZeroVec::new()) }, }; static VALUES: [&::Yokeable; 25usize] = [&AF, &AR, &AF, &AF, &AF, &AF, &AF, &AF, &FA, &AF, &HE, &AF, &KA, &LV, &MK, &AF, &FA, &AF, &RO, &FA, &AF, &SL, &AF, &UND, &AF]; static KEYS: [&str; 25usize] = ["af", "ar", "bg", "ca", "en", "es", "et", "eu", "fa", "fi", "he", "ia", "ka", "lv", "mk", "no", "or", "pcm", "ro", "sd", "si", "sl", "sv", "und", "ur"]; let mut metadata = icu_provider::DataResponseMetadata::default(); let payload = if let Ok(payload) = KEYS.binary_search_by(|k| req.locale.strict_cmp(k.as_bytes()).reverse()).map(|i| *unsafe { VALUES.get_unchecked(i) }) { payload } else { const FALLBACKER: icu::locid_transform::fallback::LocaleFallbackerWithConfig<'static> = icu::locid_transform::fallback::LocaleFallbacker::new().for_config(::KEY.fallback_config()); let mut fallback_iterator = FALLBACKER.fallback_for(req.locale.clone()); loop { if let Ok(payload) = KEYS.binary_search_by(|k| fallback_iterator.get().strict_cmp(k.as_bytes()).reverse()).map(|i| *unsafe { VALUES.get_unchecked(i) }) { metadata.locale = Some(fallback_iterator.take()); break payload; } if fallback_iterator.get().is_und() { return Err(icu_provider::DataErrorKind::MissingLocale.with_req(::KEY, req)); } fallback_iterator.step(); } }; Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(payload)), metadata }) } } }; } /// Implement `IterableDataProvider` on the given struct using the data /// hardcoded in this file. This allows the struct to be used with /// `DatagenDriver` for this key. #[doc(hidden)] #[macro_export] macro_rules! __impliterable_plurals_ranges_v1 { ($ provider : ty) => { #[clippy::msrv = "1.67"] impl icu_provider::datagen::IterableDataProvider for $provider { fn supported_locales(&self) -> Result, icu_provider::DataError> { Ok(["af", "ar", "bg", "ca", "en", "es", "et", "eu", "fa", "fi", "he", "ia", "ka", "lv", "mk", "no", "or", "pcm", "ro", "sd", "si", "sl", "sv", "und", "ur"].into_iter().map(|s| ::from_str(s).unwrap()).collect()) } } }; }