Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/plurals/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,20 +637,20 @@ pub struct FourBitMetadata(u8);
impl FourBitMetadata {
/// Creates a [`FourBitMetadata`] if the given value fits in 4 bits.
pub fn try_from_byte(byte: u8) -> Option<Self> {
if byte < 0x80 {
if byte <= 0x0F {
Some(Self(byte))
} else {
None
}
}

/// Creates a [`FourBitMetadata`] with a zero value.
pub fn zero() -> Self {
pub const fn zero() -> Self {
Self(0)
}

/// Gets the value out of a [`FourBitMetadata`].
pub fn get(self) -> u8 {
pub const fn get(self) -> u8 {
self.0
}
}
Expand Down