3 ms·
> If you want JavaScript's behavior around failure, you make the final value a Result, it's not built-in. Fun bit history: the first pass at Futures did return
by anp 7y ago
> If you want JavaScript's behavior around failure, you make the final value a Result, it's not built-in.
Fun bit history: the first pass at Futures did return an error type explicitly: https://docs.rs/futures/0.1.28/futures/future/trait.Future.html#tymethod.poll https://docs.rs/futures/0.1.28/futures/future/trait.Future.h.... IIUC the idea was that Futures were for performing I/O which is effectively always fallible. I assume that it's an easy design decision to make looking at all of the other languages with similar designs. I'm very glad Rust has nicely orthogonal "deferred"/"fallible" types now.