Call the badge callback every line
The registration batch first welcomes every supplied visitor and reports the batch count. Its payment pass prints a running admission total after every amount, then reconciles that total with the caller’s final report. Its badge pass reuses one callback for every name; badge text must remain available for the next call instead of being consumed by the first visitor.
What needs to change
Repair the callback in main so it can run once for every line.
Reproduce
- The starter does not compile; read the diagnostic before changing the code.
Acceptance criteria
Your review marks · Saved in this browser. Test acceptance is tracked separately.
Notes
The file contains its use declaration, read_rows, for_each_row and main. for_each_row takes an FnMut callback and is correct.
Input: one visitor’s name per line.
Supplied batches contain at most 1,000 single-word names. Rows are well formed; input validation is outside this task.