macro_rules! unicode_ext_value {
    ($value:literal) => { ... };
}
Expand description

A macro allowing for compile-time construction of valid Unicode Value subtag.

The macro only supports single-subtag values.

Examples

use icu::locid::{unicode_ext_key, unicode_ext_value};
use icu::locid::extensions::unicode::{Key, Value};
use icu::locid::Locale;
use writeable::Writeable;

const CALENDAR_KEY: Key = unicode_ext_key!("ca");
const CALENDAR_VALUE: Value = unicode_ext_value!("buddhist");

let loc: Locale = "de-u-ca-buddhist".parse().unwrap();

assert_eq!(
    loc.extensions.unicode.keywords.get(&CALENDAR_KEY),
    Some(&CALENDAR_VALUE)
);