News for hackers. Stuff that matters.
Re:Programming in Rust: the good, the bad, the ugly by swsieber on Tuesday March 12, 2019 @12:47PM (#19370176)
A couple of notes:

Tooling: Rust takes backwards compatibility very seriously. If you're using multiple version of a crate in your dependency try, it's very likely because those two crate versions have breaking changes between them.

Language - You should very rarely need to unwrap because of pattern matching:

Stuff like this: if (a.is_some()) { let value = a.unwrap()...

Can be rewritten like this: if let Some(value) = a { ...

Re:Programming in Rust: the good, the bad, the ugly by millstone on Tuesday March 12, 2019 @10:21PM (#19375122)
The gratuitous unwrapping comes from APIs like `Mutex::lock` and `write!`
Re:Programming in Rust: the good, the bad, the ugly by edflsafoiewq on Tuesday March 12, 2019 @11:46PM (#19375534)
IME unwrapping usually comes from the variant of an enum being determined by the ambient invariants in the program. For example, if you have a dependent pair, (x,y), x determines the variant of y. Similar consideration for switching between a array of options of pairs and a pair of arrays of options.

The simplest example of this is array subscripting. A sufficient bound on n will determine the variant of arr.get(n). The API acknowledges this common case by providing arr[n].