the biggest argument against the original suggestion makes a lot of sense to me. “Result is not part of the language”.
it’s why I nearly didn’t start this thread. I’m not surprised to hear it’s been talked about before or that some other options like “pass/fail” might crop up.
for my two cents. I love the rust Result and.Option types especially when used with the “?” operator and from types.
The “?” works well as it depends on the From/Into traits. something that is unambiguous and very powerful.
This might seem really off, but I’m curious about what people will think about this.
What about if return coercion was allowed using “From/Into” like the “?” this would be unambiguous as the return type is part of the signature.
That way () can coerce to Ok(()) by impementing
impl From<()> for Result<(),_> {...}
This might be a bit overkill, but I can’t see it being abused badly as it would still be easy enough to read even when someone has tried something weird.