3 ms·
You'd probably need to use the "default type parameter" feature for the alias otherwise std's Result is a breaking change and you have to use core's result to p
by masklinn 6y ago
You'd probably need to use the "default type parameter" feature for the alias otherwise std's Result is a breaking change and you have to use core's result to provide a custom error type, which I think would be a step back.
It's what anyhow does:
pub type Result<T, E = Error> = core::result::Result<T, E>;
That way you can still use `Result<i32, MyCustomError>`.
I don't know if there are limitations or issues with this approach though.