// @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_collator_meta_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 FR_CA: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 129u32 }; static DA: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 1545u32 }; static UND: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 1u32 }; static VI: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 25u32 }; static TH: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 297u32 }; static AM: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 33u32 }; static AR: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 41u32 }; static LT: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 73u32 }; static AF: ::Yokeable = icu::collator::provider::CollationMetadataV1 { bits: 9u32 }; static VALUES: [&::Yokeable; 88usize] = [&AF, &AM, &AR, &AR, &AR, &AR, &AM, &AR, &AF, &AR, &AF, &AM, &AF, &AF, &DA, &AF, &AF, &AF, &AM, &AF, &AF, &AF, &AF, &AR, &AF, &AF, &AF, &AF, &FR_CA, &AF, &AF, &AR, &AF, &AM, &AR, &AR, &AF, &AF, &AR, &AF, &AF, &AR, &AM, &AR, &AR, &AR, &AR, &AR, &AR, &AR, &AM, <, &AF, &AR, &AR, &AM, &AR, &DA, &AR, &AM, &AF, &AR, &AR, &AF, &AR, &AF, &AM, &AR, &AF, &AF, &AF, &AR, &AF, &AR, &AR, &TH, &AF, &AF, &AF, &AR, &AR, &UND, &AR, &AF, &VI, &AF, &AF, &AR]; static KEYS: [&str; 88usize] = ["af", "am", "ar", "as", "az", "be", "bg", "bn", "br", "bs", "ceb", "chr", "cs", "cy", "da", "de-AT-u-co-phonebk", "de-u-co-phonebk", "dsb", "el", "en-US-posix", "eo", "es", "et", "fa", "ff-Adlm", "fi", "fil", "fo", "fr-CA", "fy", "gl", "gu", "ha", "he", "hi", "hr", "hsb", "hu", "hy", "ig", "is", "ja", "ka", "kk", "km", "kn", "ko", "kok", "ku", "ky", "lo", "lt", "lv", "mk", "ml", "mn", "mr", "mt", "my", "ne", "no", "or", "pa", "pl", "ps", "ro", "ru", "si", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tk", "to", "tr", "ug", "uk", "und", "ur", "uz", "vi", "wo", "yo", "zh"]; 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_collator_meta_v1 { ($ provider : ty) => { #[clippy::msrv = "1.67"] impl icu_provider::datagen::IterableDataProvider for $provider { fn supported_locales(&self) -> Result, icu_provider::DataError> { Ok(["af", "am", "ar", "as", "az", "be", "bg", "bn", "br", "bs", "ceb", "chr", "cs", "cy", "da", "de-AT-u-co-phonebk", "de-u-co-phonebk", "dsb", "el", "en-US-posix", "eo", "es", "et", "fa", "ff-Adlm", "fi", "fil", "fo", "fr-CA", "fy", "gl", "gu", "ha", "he", "hi", "hr", "hsb", "hu", "hy", "ig", "is", "ja", "ka", "kk", "km", "kn", "ko", "kok", "ku", "ky", "lo", "lt", "lv", "mk", "ml", "mn", "mr", "mt", "my", "ne", "no", "or", "pa", "pl", "ps", "ro", "ru", "si", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tk", "to", "tr", "ug", "uk", "und", "ur", "uz", "vi", "wo", "yo", "zh"].into_iter().map(|s| ::from_str(s).unwrap()).collect()) } } }; }