Hi,
In Map
s created by rust-phf only values with a static lifetime can be used as key:
pub struct Map<K: 'static, V: 'static> { /* fields omitted */ }
I'm wondering if there is a way to use get with a non-static key. It seems the signature of get
doesn't require a static lifetime, but the compiler still rejects my attempt to use a non-static str:
490 | fn combined_phf(input: &Vec<&str>){
| ---------- help: add explicit lifetime `'static` to the type of `input`: `&std::vec::Vec<&'static str>`
...
493 | result += EVENTS.get(x).unwrap();
| ^^^ lifetime `'static` required