2017-01-26 16:18 GMT+01:00 Olaf van der Spek
On Thu, Jan 26, 2017 at 4:03 PM, Andrzej Krzemienski
wrote: Wow. Indeed Rust docs do it. This is what you are referring to: http://rustbyexample.com/std/result.html This example doesn't do good service to Rust, does it?
The implementation might be bad but I don't think the interface is bad, assuming you want to handle the errors as runtime errors.
If you want to report overflow or precision errors, then this `MathResult` makes sense. But this example illustrates some bad practice of artificially widening the contract only to report the breakage in the return value. It is as though it were saying "here is how you can use Rust's Result to write poor code". Ok, but does it help me write good code? Regards, &rzej;