Why do I have to use &char instead of char to index a key in a HashMap?
In the following snippet, given the type of 'a'
is char
, why can’t I print letters['a']
?
Why do I have to use &char instead of char to index a key in a HashMap?
In the following snippet, given the type of 'a'
is char
, why can’t I print letters['a']
?
How to filter and clone HashMap in Rust?
I’ve got a simple task: filter existing HashMap and clone it into a new variable in Rust.