Skip to content

Commit

Permalink
Add Value::new_empty()
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Dec 16, 2024
1 parent b6fd005 commit e90591f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions components/locale_core/src/extensions/unicode/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,19 @@ impl Value {
self.0.len()
}

/// Creates an empty [`Value`], which corresponds to a "true" value.
///
/// # Examples
///
/// ```
/// use icu::locale::extensions::unicode::{value, Value};
///
/// assert_eq!(value!("true"), Value::new_empty());
/// ```
pub const fn new_empty() -> Self {
Self(ShortBoxSlice::new())
}

/// Returns `true` if the Value has no subtags.
///
/// # Examples
Expand Down

0 comments on commit e90591f

Please sign in to comment.