Macro icu_locid_macros::language[][src]

language!() { /* proc-macro */ }

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

The macro will perform syntax canonicalization of the tag.

Examples

use icu::locid::subtags::Language;
use icu::locid::macros::language;

const DE: Language = language!("DE");

let de: Language = "DE".parse()
    .expect("Failed to parse language subtag.");

assert_eq!(DE, "de");
assert_eq!(DE, de);