Rust iterators and adapters

F-ITER-V4-3hard

Report the orders

A candle shop restocks lots, clears sold-out scents and reports orders.

What needs to change

Repair report so the count, the total and the rejected lines all come from the orders.

Reproduce

  1. 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 imports, the physical-record reader, supplied decoder and complete main.

Input: an order file of LF/CRLF physical records, with an optional unterminated final record. Every physical row counts, including blank rows. ASCII space/tab/CR framing is trimmed. The supplied decode_quantity helper returns Ok only for nonempty ASCII decimal digits whose value fits u32, including zero and leading zeros; all other text returns Err. The accepted quantities must also total at most u32::MAX.

Sign in to open this exercise

The ticket brief is public. Sign in to access the exercise. Paid exercises require Pro.

Sign in