Slug: enum-match-01 · Paired reading: Chapters 2 and 7
Prompt
Define enum Status { Ready, Pending, Failed } and
fn label(s: Status) -> &'static str with an exhaustive match
(no wildcard). Return short labels for each variant.
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 36
Slug: enum-match-01 · Paired reading: Chapters 2 and 7
Define enum Status { Ready, Pending, Failed } and
fn label(s: Status) -> &'static str with an exhaustive match
(no wildcard). Return short labels for each variant.