Function quickphf_codegen::build_raw_map
source · pub fn build_raw_map<'a, K: Eq + Hash, V: ConstInstantiable>(
keys: &'a [K],
values: &'a [V]
) -> CodeWriter<'a, K, V>
Expand description
Generate code for a static quickphf::RawPhfMap
.
Examples
use quickphf_codegen::*;
let months = [
"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec",
];
let holidays = [2, 1, 0, 0, 0, 1, 1, 0, 1, 1, 2, 1];
let holidays_per_month = build_raw_map(&months, &holidays);