Slug: err-design-02 · Paired reading: Chapters 2 and 8
Prompt
Anyhow-style without the crate: fn load_port(cfg: &str) -> Result<u16, String>
parses a port and wraps failures with context via map_err
(e.g. prefix loading port: ).
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? The landing page stays open — purchase unlocks this gym.
beginner · order 41
Slug: err-design-02 · Paired reading: Chapters 2 and 8
Anyhow-style without the crate: fn load_port(cfg: &str) -> Result<u16, String>
parses a port and wraps failures with context via map_err
(e.g. prefix loading port: ).