Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But it's also not marked at the implementation for HashMap's Index impl for instance.


This didn't seem like a footgun to me, hats["Jim"]; will panic if, in fact "Jim" isn't one of the keys, but what did the hypothetical author expect to happen when they write this? HashMap doesn't implement IndexMut so hats["Jim"] = 26; won't even compile.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: