code icon indicating copy to clipboard operation
code copied to clipboard

ch8: wraperror2: remove map_err() call

Open ewenmcneill opened this issue 3 years ago • 0 comments

To match the book text (Listing 8.15, which is supposed to match ch8/misc/wraperror2.rs), actually remove the map_err() calls that are not supposed to be needed once the std::convert::From trait is implemented for the wrapped types.

Without this change, the difference between wraperror.rs and wraperror2.rs is not particularly obvious, as the std::convert::From traits are unnecessary. (The code does compile without this change, because the in repository implementation is basically the same as ch8/misc/wraperror.rs.)

ETA: Force pushed a replacement to fix typo in commit comment that I noticed while editing the PR text.

ewenmcneill avatar Jan 10 '23 03:01 ewenmcneill