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

Teeeny tiny note

> because Rust's get function v.get(i) is marked unsafe

You mean get_unchecked. get is safe, and returns an Option, so that None can be returned if something is out of bounds.



Doh! I even had the "get_unchecked()" function in front of me on the screen and wrote get() anyway. Thanks Steve.


No problem. Thanks for explaining what unsafe does and doesn't do; you're 100% right that this is a common misconception that comes up often.




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

Search: