by namjh · 1y ago · 0 comments
This is true only if you add #[from] attribute to a variant. Implementing std::convert::From is completely optional. Personally I don't prefer it too as it ambiguates the context. I only use it for "trivially" wrapped errors like eyre::Report.
enum CarWontMove {
EngineTroubles(EngineTroubles),
WheelsFellOff(WheelsFellOff),
}
Even then, there’s often some additional context you can affix at that higher level.[0]: https://docs.rs/snafu/latest/snafu/derive.Snafu.html#disabli...
[1]: https://docs.rs/snafu/latest/snafu/derive.Snafu.html#delegat...