Skip to content

Commit

Permalink
Make PluralRulesWithRanges experimental (#4269)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 authored Nov 10, 2023
1 parent 09c5200 commit d06bd6f
Show file tree
Hide file tree
Showing 19 changed files with 243 additions and 915 deletions.
5 changes: 4 additions & 1 deletion components/icu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,14 @@ serde_human = [
icu_datetime_experimental = [
"icu_datetime/experimental",
]
icu_plurals_experimental = [
"icu_plurals/experimental"
]
experimental = [
"icu_compactdecimal",
"icu_datetime_experimental",
"icu_displaynames",
"icu_plurals/experimental",
"icu_plurals_experimental",
"icu_relativetime",
"icu_transliterate",
]
Expand Down
15 changes: 14 additions & 1 deletion components/plurals/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ pub use operands::PluralOperands;
use provider::CardinalV1Marker;
use provider::ErasedPluralRulesV1Marker;
use provider::OrdinalV1Marker;
use rules::runtime::test_rule;

#[cfg(feature = "experimental")]
use provider::PluralRangesV1Marker;
#[cfg(feature = "experimental")]
use provider::UnvalidatedPluralRange;
use rules::runtime::test_rule;

#[doc(no_inline)]
pub use PluralsError as Error;
Expand Down Expand Up @@ -556,6 +559,14 @@ impl PluralRules {
/// A [`PluralRules`] that also has the ability to retrieve an appropriate [`Plural Category`] for a
/// range.
///
/// ✨ *Enabled with the `experimental` Cargo feature.*
///
/// <div class="stab unstable">
/// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways,
/// including in SemVer minor releases. Use with caution.
/// <a href="https://github.com/unicode-org/icu4x/issues/4140">#4140</a>
/// </div>
///
/// # Examples
///
/// ```
Expand All @@ -581,12 +592,14 @@ impl PluralRules {
/// ```
///
/// [`Plural Category`]: PluralCategory
#[cfg(feature = "experimental")]
#[derive(Debug)]
pub struct PluralRulesWithRanges {
rules: PluralRules,
ranges: DataPayload<PluralRangesV1Marker>,
}

#[cfg(feature = "experimental")]
impl PluralRulesWithRanges {
icu_provider::gen_any_buffer_data_constructors!(
locale: include,
Expand Down
Loading

0 comments on commit d06bd6f

Please sign in to comment.