Challenge 1: Adding a Clear Command — Possible Solution ==================================================================== #[derive(clap::Subcommand)] enum Commands { Add { description: String }, List, Complete { id: u32 }, Remove { id: u32 }, Clear, } // Inside main()'s match cli.command block: Commands::Clear => { tasks.clear(); } WHY THIS WORKS AS AN ANSWER ------------------------------ Clear is added as a new variant of the Commands enum with NO associated data — following the same pattern as the existing List variant, which also carries no fields, since "clear everything" needs no additional arguments the way Add's description or Complete/Remove's id do. Because clap::Subcommand is a DERIVE MACRO (this chapter's own procedural-macro payoff from Chapter 4), simply adding the new Clear variant to the enum is enough — clap automatically generates the necessary CLI parsing logic to recognize a new "clear" subcommand with no arguments, with no manual parser code to write by hand. tasks.clear() is Vec's own built-in method for removing all elements in place — the simplest possible way to empty the vector, matching this chapter's existing Remove variant's use of Vec's built-in .retain() method for a similar "modify the collection in place" style of implementation. Adding this arm to the match block is required because match, per Course 1 Chapter 6, is EXHAUSTIVE — the compiler would refuse to compile main() with the new Clear variant present in the enum but missing from this match block, correctly flagging that every variant needs to be handled.