monica_b1998@lemmy.world to Rust@programming.dev · 3 months agoError Handling in Rust vs. Exceptions in other languagesslicker.meexternal-linkmessage-square24linkfedilinkarrow-up136arrow-down11
arrow-up135arrow-down1external-linkError Handling in Rust vs. Exceptions in other languagesslicker.memonica_b1998@lemmy.world to Rust@programming.dev · 3 months agomessage-square24linkfedilink
minus-squareKindaABigDyl@programming.devlinkfedilinkarrow-up10·3 months agoI think this is more idiomatic: let result = foo(a, b) .map_err(|e| MyErrorEnum::Error(e.to_string()));
I think this is more idiomatic:
let result = foo(a, b) .map_err(|e| MyErrorEnum::Error(e.to_string()));