Re:100 days with Rust: a series of brick walls
by xfer on Friday March 23, 2018 @09:22PM
(#16664146)
There is zero friction if you use either error_chain/failure crate and you can still recover the precise underlying errors. The only thing is it allocates.
Re:100 days with Rust: a series of brick walls
by arghwhat on Saturday March 24, 2018 @07:34AM
(#16666093)
I will look into those crates next time!
Re:100 days with Rust: a series of brick walls
by red75prime on Saturday March 24, 2018 @01:21AM
(#16665022)
failure has no_std feature for the no-heap cases.
Having to implement a bunch of From traits (unless you need io::Error, because everything seemed to have conversions from/to that), or having to implement inline error conversion through map_err, is such friction. I might go as far as consider it the most cumbersome error system I have used. Clean idea, cumbersome implementation.
My comment about '?' not working with mismatched types was mostly just to say that it doesn't fix anything, it just adds a bit of convenient syntactic sugar.