Rust

Handling HashMap with byte-string keys in Rust

Recently, I've tried to create a hash map whose key is a "byte string" in Rust. A naive code would be something like this: letm=HashMap<Vec<u8>,V> Note that using a borrowed type, like &[u8], as key is not a good idea. Of course, this does work but it would little bit inconvenient if you would like to use the key like a "string", e.g., m.get("ascii string") However, it will cause a compilation error.