I see some issues with your conclusion. You indicate that we humans have limited attention but quite frankly there are a numerous amounts of constructs that require our attention in Rust and I fail quite a lot to do so yet it would not be adequate to just add macros that does some magic .... luckily we have the compiler, the Rust compiler with its great error messages solves any problems with out lack of attention and makes us take explicit decisions.
I find all the examples without the Ok to be less readable and if I had to maintain such code I would have problems having to discern when values are being packaged to be returned. Having the Ok construct makes thing quite easier. Specially if people are going to have huge match statements that actually output the function's result.
I rather have things explicitly and being reminded by the compiler than implicitly and then wondering why things are not working out to then have to deal with a Macro that is doing stuff to my code...
Luckily we have crates (would not make this statement in C/C++ land) and if you want this kind of magical macros you can just import it as you do now.
Can´t really see the issue
Date: 2022-12-22 09:18 am (UTC)I find all the examples without the Ok to be less readable and if I had to maintain such code I would have problems having to discern when values are being packaged to be returned. Having the Ok construct makes thing quite easier. Specially if people are going to have huge match statements that actually output the function's result.
I rather have things explicitly and being reminded by the compiler than implicitly and then wondering why things are not working out to then have to deal with a Macro that is doing stuff to my code...
Luckily we have crates (would not make this statement in C/C++ land) and if you want this kind of magical macros you can just import it as you do now.