Hash of String or &str

How do I compute a hash of a string or &str? String doesn't implement the Hash trait. I could wrap inside a struct and implement Hash for it. But seems overly complicated.

String does implement Hash:

What is your actual problem?

6 Likes

Aaaargh. I apologize. I just didn't read the error properly. I had to bring the Trait into scope. I apologize. Thanks.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.