3 ms·
In Rust, when you use `?`, it includes a step to convert the error type of the expression it was used on into the (possibly different) error type that the curre
by int_19h 4y ago
In Rust, when you use `?`, it includes a step to convert the error type of the expression it was used on into the (possibly different) error type that the current function returns. So if you need to map low-level errors to high-level ones in a consistent way, you'd just do it once when defining that error type.
- randomdata 4y agoWhich too requires the language to have a 'the producer is always right' over a 'the customer is always right' design, which Rust does. It all works well when the language is designed for it, but it has to be there at the macro level. Definitely not a 'microfeature'.
- still_grokking 4y ago> Which too requires the language to have a 'the producer is always right' over a 'the customer is always right' design, which Rust does. What do you mean by those two quoted terms?