A guide to error handling in Rust
Too bad Rust doesn't have union types (aka adhoc / anonymous unions) yet.Without them, using typed errors is very clumsy. Optimally, you would write the following code:    fn foo(r1: Result, r: Result) {
        let i1 = r1?;
        let i2 = r2?;
        // ...
    }

and Rust would infer the return type to be Result
without having to do any extra definitions or conversions.