News for hackers. Stuff that matters.
Re:Announcing Rust 1.9 by oconnor663 on Thursday May 26, 2016 @09:56PM (#11783364)
In cases where the caller might want to handle an error, Rust almost always uses an Option/Result. For vectors, the `get` method lets you try to get an element out without panicking if your index is bad. (Or of course you can just check the index manually. This is guaranteed to be threadsafe, which is nice.) The try! macro is the standard way to say "I don't want to handle errors here -- you take care of it."

There are no comments on this comment yet.