Skip to content

Commit

Permalink
s/data_struct_new/data_struct
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Feb 26, 2025
1 parent e15b2bf commit 467037a
Show file tree
Hide file tree
Showing 43 changed files with 83 additions and 83 deletions.
4 changes: 2 additions & 2 deletions components/calendar/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub struct JapaneseEras<'data> {
pub dates_to_eras: ZeroVec<'data, (EraStartDate, TinyStr16)>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
JapaneseEras<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -164,7 +164,7 @@ pub struct WeekData {
pub weekend: WeekdaySet,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
WeekData,
#[cfg(feature = "datagen")]
);
Expand Down
2 changes: 1 addition & 1 deletion components/calendar/src/provider/chinese_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub struct ChineseBasedCache<'data> {
pub data: ZeroVec<'data, PackedChineseBasedYearInfo>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
ChineseBasedCache<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
2 changes: 1 addition & 1 deletion components/calendar/src/provider/islamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct IslamicCache<'data> {
pub data: ZeroVec<'data, PackedIslamicYearInfo>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
IslamicCache<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
2 changes: 1 addition & 1 deletion components/casemap/src/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub struct CaseMap<'data> {
pub exceptions: CaseMapExceptions<'data>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
CaseMap<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
2 changes: 1 addition & 1 deletion components/casemap/src/provider/unfold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct CaseMapUnfold<'data> {
pub map: ZeroMap<'data, PotentialUtf8, str>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
CaseMapUnfold<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
12 changes: 6 additions & 6 deletions components/collator/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub struct CollationData<'data> {
pub contexts: ZeroVec<'data, u16>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
CollationData<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -308,7 +308,7 @@ pub struct CollationDiacritics<'data> {
pub secondaries: ZeroVec<'data, u16>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
CollationDiacritics<'_>,
#[cfg(feature = "datagen")]
);
Expand All @@ -331,7 +331,7 @@ pub struct CollationJamo<'data> {
pub ce32s: ZeroVec<'data, u32>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
CollationJamo<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -386,7 +386,7 @@ pub struct CollationReordering<'data> {
pub reorder_ranges: ZeroVec<'data, u32>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
CollationReordering<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -449,7 +449,7 @@ pub struct CollationMetadata {
pub bits: u32,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
CollationMetadata,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -543,7 +543,7 @@ pub struct CollationSpecialPrimaries<'data> {
pub numeric_primary: u8,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
CollationSpecialPrimaries<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
4 changes: 2 additions & 2 deletions components/datetime/src/provider/calendar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub struct DateLengths<'data> {
pub length_combinations: patterns::GenericLengthPatterns<'data>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
DateLengths<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -147,7 +147,7 @@ pub struct TimeLengths<'data> {
pub preferred_hour_cycle: pattern::CoarseHourCycle,
}

icu_provider::data_struct_new!(TimeLengths<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(TimeLengths<'_>, #[cfg(feature = "datagen")]);

/// Data structs for date / time patterns that store data corresponding to pattern lengths
/// and/or plural forms.
Expand Down
4 changes: 2 additions & 2 deletions components/datetime/src/provider/calendar/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub struct DateSymbols<'data> {
pub eras: Eras<'data>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
DateSymbols<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -142,7 +142,7 @@ pub struct TimeSymbols<'data> {
pub day_periods: day_periods::Contexts<'data>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
TimeSymbols<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
10 changes: 5 additions & 5 deletions components/datetime/src/provider/neo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ pub enum YearNames<'data> {
Cyclic(#[cfg_attr(feature = "serde", serde(borrow))] VarZeroVec<'data, str>),
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
YearNames<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -629,7 +629,7 @@ pub enum MonthNames<'data> {
),
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
MonthNames<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -663,7 +663,7 @@ pub struct LinearNames<'data> {
pub names: VarZeroVec<'data, str>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
LinearNames<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -716,7 +716,7 @@ pub struct GluePattern<'data> {
pub pattern: runtime::GenericPattern<'data>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
GluePattern<'_>,
#[cfg(feature = "datagen")]
);
Expand All @@ -736,7 +736,7 @@ pub struct DateTimeSkeletons<'data> {
pub map: ZeroMap<'data, str, PatternULE>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
DateTimeSkeletons<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
2 changes: 1 addition & 1 deletion components/datetime/src/provider/packed_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub struct PackedPatterns<'data> {
pub elements: VarZeroVec<'data, PluralElementsPackedULE<ZeroSlice<PatternItem>>>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
PackedPatterns<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
12 changes: 6 additions & 6 deletions components/datetime/src/provider/time_zones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub struct TimeZoneEssentials<'data> {
pub offset_unknown: Cow<'data, str>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
TimeZoneEssentials<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -201,7 +201,7 @@ pub struct Locations<'data> {
pub pattern_partial_location: Cow<'data, DoublePlaceholderPattern>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
Locations<'_>,
#[cfg(feature = "datagen")]
);
Expand All @@ -226,7 +226,7 @@ pub struct ExemplarCities<'data> {
pub exemplars: ZeroMap<'data, TimeZone, str>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
ExemplarCities<'_>,
#[cfg(feature = "datagen")]
);
Expand All @@ -253,7 +253,7 @@ pub struct MetazoneGenericNames<'data> {
pub overrides: ZeroMap<'data, TimeZone, str>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
MetazoneGenericNames<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -286,7 +286,7 @@ pub struct MetazoneSpecificNames<'data> {
pub use_standard: ZeroVec<'data, MetazoneId>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
MetazoneSpecificNames<'_>,
#[cfg(feature = "datagen")]
);
Expand Down Expand Up @@ -320,7 +320,7 @@ pub struct MetazonePeriod<'data> {
pub list: ZeroMap2d<'data, TimeZone, MinutesSinceEpoch, NichedOption<MetazoneId, 1>>,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
MetazonePeriod<'_>,
#[cfg(feature = "datagen")]
);
2 changes: 1 addition & 1 deletion components/decimal/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub struct DecimalSymbols<'data> {
pub grouping_sizes: GroupingSizes,
}

icu_provider::data_struct_new!(
icu_provider::data_struct!(
DecimalSymbols<'_>,
#[cfg(feature = "datagen")]
);
Expand Down
2 changes: 1 addition & 1 deletion components/experimental/src/compactdecimal/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub struct CompactDecimalPatternData<'data> {
pub patterns: ZeroMap2d<'data, i8, Count, PatternULE>,
}

icu_provider::data_struct_new!(CompactDecimalPatternData<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(CompactDecimalPatternData<'_>, #[cfg(feature = "datagen")]);

/// A CLDR plural keyword, or the explicit value 1.
/// See <https://www.unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules>.
Expand Down
2 changes: 1 addition & 1 deletion components/experimental/src/dimension/provider/currency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub struct CurrencyEssentials<'data> {
pub default_pattern_config: CurrencyPatternConfig,
}

icu_provider::data_struct_new!(CurrencyEssentials<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(CurrencyEssentials<'_>, #[cfg(feature = "datagen")]);

#[zerovec::make_ule(PatternSelectionULE)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct ShortCurrencyCompact<'data> {
pub compact_patterns: ZeroMap<'data, (i8, CompactCount), str>,
}

icu_provider::data_struct_new!(ShortCurrencyCompact<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(ShortCurrencyCompact<'_>, #[cfg(feature = "datagen")]);

#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ pub struct CurrencyDisplayname<'data> {
pub display_name: Cow<'data, str>,
}

icu_provider::data_struct_new!(CurrencyDisplayname<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(CurrencyDisplayname<'_>, #[cfg(feature = "datagen")]);
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pub struct CurrencyPatternsData<'data> {
pub patterns: PluralElementsPackedCow<'data, DoublePlaceholderPattern>,
}

icu_provider::data_struct_new!(CurrencyPatternsData<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(CurrencyPatternsData<'_>, #[cfg(feature = "datagen")]);
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct CurrencyExtendedData<'data> {
pub display_names: PluralElementsPackedCow<'data, str>,
}

icu_provider::data_struct_new!(CurrencyExtendedData<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(CurrencyExtendedData<'_>, #[cfg(feature = "datagen")]);

impl<'data> CurrencyExtendedData<'data> {
/// Construct an instance directly from a byte slice.
Expand Down
2 changes: 1 addition & 1 deletion components/experimental/src/dimension/provider/percent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ pub struct PercentEssentials<'data> {
pub plus_sign: Cow<'data, str>,
}

icu_provider::data_struct_new!(PercentEssentials<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(PercentEssentials<'_>, #[cfg(feature = "datagen")]);
2 changes: 1 addition & 1 deletion components/experimental/src/dimension/provider/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct UnitsDisplayName<'data> {
pub patterns: PluralElementsPackedCow<'data, SinglePlaceholderPattern>,
}

icu_provider::data_struct_new!(UnitsDisplayName<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(UnitsDisplayName<'_>, #[cfg(feature = "datagen")]);

impl<'data> UnitsDisplayName<'data> {
/// Construct an instance directly from a byte slice.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct UnitsEssentials<'data> {
pub times: Cow<'data, str>,
}

icu_provider::data_struct_new!(UnitsEssentials<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(UnitsEssentials<'_>, #[cfg(feature = "datagen")]);

/// A CLDR plural keyword, or the explicit value 1.
/// See <https://www.unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules>. // TODO??
Expand Down
10 changes: 5 additions & 5 deletions components/experimental/src/displaynames/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct RegionDisplayNames<'data> {
pub short_names: ZeroMap<'data, UnvalidatedRegion, str>,
}

icu_provider::data_struct_new!(RegionDisplayNames<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(RegionDisplayNames<'_>, #[cfg(feature = "datagen")]);

#[derive(Debug, PartialEq, Clone, Default, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
Expand All @@ -98,7 +98,7 @@ pub struct LanguageDisplayNames<'data> {
pub menu_names: ZeroMap<'data, UnvalidatedLanguage, str>,
}

icu_provider::data_struct_new!(LanguageDisplayNames<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(LanguageDisplayNames<'_>, #[cfg(feature = "datagen")]);

#[derive(Debug, PartialEq, Clone, Default, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
Expand All @@ -115,7 +115,7 @@ pub struct ScriptDisplayNames<'data> {
pub short_names: ZeroMap<'data, UnvalidatedScript, str>,
}

icu_provider::data_struct_new!(ScriptDisplayNames<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(ScriptDisplayNames<'_>, #[cfg(feature = "datagen")]);

#[derive(Debug, PartialEq, Clone, Default, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
Expand All @@ -138,7 +138,7 @@ pub struct LocaleDisplayNames<'data> {
pub menu_names: ZeroMap<'data, UnvalidatedLocale, str>,
}

icu_provider::data_struct_new!(LocaleDisplayNames<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(LocaleDisplayNames<'_>, #[cfg(feature = "datagen")]);

#[derive(Debug, PartialEq, Clone, Default, yoke::Yokeable, zerofrom::ZeroFrom)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
Expand All @@ -152,4 +152,4 @@ pub struct VariantDisplayNames<'data> {
pub names: ZeroMap<'data, UnvalidatedVariant, str>,
}

icu_provider::data_struct_new!(VariantDisplayNames<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(VariantDisplayNames<'_>, #[cfg(feature = "datagen")]);
2 changes: 1 addition & 1 deletion components/experimental/src/duration/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct DigitalDurationData<'data> {
pub ms_padding: MsPadding,
}

icu_provider::data_struct_new!(DigitalDurationData<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(DigitalDurationData<'_>, #[cfg(feature = "datagen")]);

#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
Expand Down
2 changes: 1 addition & 1 deletion components/experimental/src/measure/provider/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ pub struct UnitsTrie<'data> {
pub trie: ZeroTrieSimpleAscii<ZeroVec<'data, u8>>,
}

icu_provider::data_struct_new!(UnitsTrie<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(UnitsTrie<'_>, #[cfg(feature = "datagen")]);
2 changes: 1 addition & 1 deletion components/experimental/src/personnames/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct PersonNamesFormat<'data> {
pub person_names_patterns: VarZeroVec<'data, PersonNamesFormattingDataVarULE>,
}

icu_provider::data_struct_new!(PersonNamesFormat<'_>, #[cfg(feature = "datagen")]);
icu_provider::data_struct!(PersonNamesFormat<'_>, #[cfg(feature = "datagen")]);

/// Person Name Attributes.
/// {order=givenFirst, length=long, usage=referring, formality=formal}
Expand Down
Loading

0 comments on commit 467037a

Please sign in to comment.