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