I have a hashmap of type HashMap<String, &[T]>.
HashMap<String, &[T]>
Calling hashmap.get(&key), returns an Option<&&[T]>. [Double ampersand]
hashmap.get(&key)
Option<&&[T]>
How do I convert that to Option<&[T]>? [Single ampersand]
Option<&[T]>
All & references are Copy, so you can use Option::copied:
&
Copy
Option::copied
hashmap.get(&key).copied()