Skip to content

Commit

Permalink
features
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Sep 8, 2024
1 parent 8e7d04d commit 5216074
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions components/plurals/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
//! Read more about data providers: [`icu_provider`]
use crate::rules::runtime::ast::Rule;
use crate::{PluralCategory, PluralElements, PluralOperands, PluralRules};
use alloc::borrow::{Cow, ToOwned};
use alloc::vec::Vec;
use alloc::boxed::Box;
use core::fmt;
use core::marker::PhantomData;
use icu_provider::prelude::*;
Expand All @@ -25,11 +29,13 @@ use zerovec::ule::vartuple::TinyVarVarError;
use zerovec::ule::vartuple::TinyVarVarULE;
use zerovec::ule::vartuple::VarTuple;
use zerovec::ule::vartuple::VarTupleULE;
use zerovec::ule::AsULE;
use zerovec::ule::EncodeAsVarULE;
use zerovec::ule::UleError;
use zerovec::ule::VarULE;
use zerovec::ule::ULE;
use zerovec::VarZeroSlice;
use zerovec::VarZeroVec;

#[cfg(feature = "compiled_data")]
#[derive(Debug)]
Expand Down Expand Up @@ -332,13 +338,6 @@ mod ranges {
}
}

#[cfg(any(doc, feature = "datagen"))]
use crate::PluralElements;
use crate::{PluralCategory, PluralOperands, PluralRules};
use alloc::borrow::Cow;
use zerovec::ule::AsULE;
use zerovec::VarZeroVec;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[zerovec::make_ule(PluralCategoryV1ULE)]
#[repr(u8)]
Expand Down Expand Up @@ -746,6 +745,7 @@ impl<V> PluralElementsPackedULE<V>
where
V: VarULE + PartialEq + ?Sized,
{
#[cfg(feature = "datagen")]
fn to_plural_elements(&self) -> PluralElements<(FourBitMetadata, &V)> {
let (default, specials) = self.as_parts();
let mut elements = PluralElements::new(default);
Expand Down Expand Up @@ -847,6 +847,7 @@ where
}
}

#[cfg(feature = "serde")]
impl<'de, 'data, V> serde::Deserialize<'de> for &'data PluralElementsPackedULE<V>
where
'de: 'data,
Expand All @@ -867,6 +868,7 @@ where
}
}

#[cfg(feature = "serde")]
impl<'de, V> serde::Deserialize<'de> for Box<PluralElementsPackedULE<V>>
where
V: VarULE + ?Sized,
Expand All @@ -890,6 +892,7 @@ where
}
}

#[cfg(feature = "datagen")]
impl<V> serde::Serialize for PluralElementsPackedULE<V>
where
V: PartialEq + serde::Serialize + VarULE + ?Sized,
Expand All @@ -907,6 +910,7 @@ where
}
}

#[cfg(feature = "datagen")]
impl<'a, V> databake::Bake for &'a PluralElementsPackedULE<V>
where
&'a V: databake::Bake,
Expand All @@ -921,6 +925,7 @@ where
}
}

#[cfg(feature = "datagen")]
impl<'a, V> databake::BakeSize for &'a PluralElementsPackedULE<V>
where
&'a V: databake::Bake,
Expand Down

0 comments on commit 5216074

Please sign in to comment.