2 ms·
Rust's thread library is designed to encourage this kind of programming. In fact, one of the goals of Servo is to use this pattern in a finer-grained way than e
by pcwalton 12y ago
Rust's thread library is designed to encourage this kind of programming. In fact, one of the goals of Servo is to use this pattern in a finer-grained way than existing browser engines do. (For example, if an image decoder crashes, wouldn't it be nice if you just got a broken image icon instead of a crashed tab?)
- saurik 12y agoBut with Result encouraged over panic, you can't get to the point of being able to code the main "happy" path without peppering it throughout with calls to unwrap and expansions of try! :(. If this is really how people are being encouraged to develop (and that would be amazing, I just haven't seen it in the Rust code I've seen, which all seems to be closer to how BurntSushi's article deals with error composition), then the error propagation mechanism that developers use as their main way of indicating failure needs to be implicit, something like unchecked exceptions, much closer to panic than Result.