[go: up one dir, main page]

deser-hjson 0.1.13

a Hjson deserializer for Serde
Documentation
#![allow(unused_macros)]

// allows writing vo!["a", "b"] to build a vec of strings
macro_rules! vo {
    ($($item:literal),* $(,)?) => {{
        let mut vec = Vec::new();
        $(
            vec.push($item.to_owned());
        )*
        vec
    }}
}

// allows writing mo!{"a":"b", "c":"d"} to build a map of strings to strings
macro_rules! mo {
    ($($key:literal:$value:literal),* $(,)?) => {{
        let mut map = HashMap::new();
        $(
            map.insert($key.to_owned(), $value.to_owned());
        )*
        map
    }}
}