Suggestion: lookup table construction with const fnΒ #188
Open
Description
Currently lookup tables are contructed with macros, where keys and values are almost literals. With constant functions, one can use a rich set of builtin constant expressions during the construction of lookup tables. For example,
const A: &str = "aaa";
const B: &str = "bbb";
const TABLE: Map<&'static str, i32> = phf_map(&[
(A, 1 * 3 * 5),
(B, [1,2,3,4].len() as i32),
]);