Skip to main content

firestore/
struct_path_macro.rs

1#[macro_export]
2macro_rules! path {
3    ($($x:tt)*) => {{
4        $crate::struct_path::path!($($x)*).to_string()
5    }};
6}
7
8#[macro_export]
9macro_rules! paths {
10    ($($x:tt)*) => {{
11        $crate::struct_path::paths!($($x)*).iter().map(|s| s.to_string()).collect::<Vec<String>>()
12    }};
13}
14
15#[macro_export]
16macro_rules! path_camel_case {
17    ($($x:tt)*) => {{
18        $crate::struct_path::path!($($x)*;case="camel").to_string()
19    }};
20}
21
22#[macro_export]
23macro_rules! paths_camel_case {
24    ($($x:tt)*) => {{
25        $crate::struct_path::paths!($($x)*;case="camel").into_iter().map(|s| s.to_string()).collect::<Vec<String>>()
26    }}
27}