rocket_accept_language/macros.rs
1/// This macro can be used to create a `Vec<LanguageIdentifier>` instance quickly by providing multiple `<language>[-<region>]` or `<language>[_<region>]` strings separated by commas.
2#[macro_export]
3macro_rules! language_region_pairs {
4 ($($id:expr),* $(,)*) => {
5 vec![$($crate::unic_langid::langid!($id),)*]
6 };
7}
8
9/// This macro can be used to create a `Language` instance constantly .
10#[macro_export]
11macro_rules! language {
12 ($id:expr) => {
13 $crate::unic_langid::lang!($id)
14 };
15}
16
17/// This macro can be used to create a `Region` instance constantly .
18#[macro_export]
19macro_rules! region {
20 ($id:expr) => {
21 $crate::unic_langid::region!($id)
22 };
23}