3 ms·
I was thinking no, but I guess you could do something like https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7c19e5e077d082eaf56061675cc4d
by steveklabnik 6y ago
I was thinking no, but I guess you could do something like https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7c19e5e077d082eaf56061675cc4d887 https://play.rust-lang.org/?version=stable&mode=debug&editio...
- masklinn 6y agoYou'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.