fn main() -> Result<T,E> {
...
x = f1()?;
y = f2()?;
z = f3()?;
...
Ok(())
}
In this example, suppose f1
, f2
, f3
return results with different error types.
I know that the above code cannot be correct because all the ?
error types have to match that of the main
function. What's the best way to deal with this without changing the structure too much?