1 | // @generated |
2 | /// Implement `DataProvider<CollationFallbackSupplementV1Marker>` on the given struct using the data |
3 | /// hardcoded in this file. This allows the struct to be used with |
4 | /// `icu`'s `_unstable` constructors. |
5 | #[doc (hidden)] |
6 | #[macro_export ] |
7 | macro_rules! __impl_fallback_supplement_co_v1 { |
8 | ($ provider : ty) => { |
9 | #[clippy::msrv = "1.66" ] |
10 | const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; |
11 | #[clippy::msrv = "1.66" ] |
12 | impl $provider { |
13 | #[doc(hidden)] |
14 | pub const SINGLETON_FALLBACK_SUPPLEMENT_CO_V1: &'static <icu::locid_transform::provider::CollationFallbackSupplementV1Marker as icu_provider::DataMarker>::Yokeable = &icu::locid_transform::provider::LocaleFallbackSupplementV1 { |
15 | parents: unsafe { |
16 | #[allow(unused_unsafe)] |
17 | zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b" \x01\0\0\0\0\0yue" ) }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"zh \0\x01Hant \0\0\0\0" ) }) |
18 | }, |
19 | unicode_extension_defaults: unsafe { |
20 | #[allow(unused_unsafe)] |
21 | zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"co" ) }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b" \x02\0\0\0" ) }, unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b" \x02\0\0\0\0\0\x02\0zhzh-Hant" ) }, unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b" \x02\0\0\0\0\0\x06\0pinyinstroke" ) }) |
22 | }, |
23 | }; |
24 | } |
25 | #[clippy::msrv = "1.66" ] |
26 | impl icu_provider::DataProvider<icu::locid_transform::provider::CollationFallbackSupplementV1Marker> for $provider { |
27 | fn load(&self, req: icu_provider::DataRequest) -> Result<icu_provider::DataResponse<icu::locid_transform::provider::CollationFallbackSupplementV1Marker>, icu_provider::DataError> { |
28 | if req.locale.is_empty() { |
29 | Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(Self::SINGLETON_FALLBACK_SUPPLEMENT_CO_V1)), metadata: Default::default() }) |
30 | } else { |
31 | Err(icu_provider::DataErrorKind::ExtraneousLocale.with_req(<icu::locid_transform::provider::CollationFallbackSupplementV1Marker as icu_provider::KeyedDataMarker>::KEY, req)) |
32 | } |
33 | } |
34 | } |
35 | }; |
36 | } |
37 | |