Macro icu::locid::extensions_unicode_key
source · [−]macro_rules! extensions_unicode_key {
($string:literal) => { ... };
}
Expand description
A macro allowing for compile-time construction of valid Key
subtags.
Examples
Parsing errors don’t have to be handled at runtime:
assert_eq!(
icu_locid::extensions_unicode_key!("ca"),
"ca".parse::<icu_locid::extensions :: unicode :: Key>().unwrap()
);
Invalid input is a compile failure:
ⓘ
icu_locid::extensions_unicode_key!("a");
Key
: crate::extensions :: unicode :: Key