Rust iterators and adapters

F-ITER-V4-2medium

Clear sold-out scents

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

What needs to change

Repair clear_sold_out so sold-out scents leave the shelf.

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, read_lines, the Item struct, parse and the complete main.

Input: up to 50 valid scent left records, delimited by LF/CRLF. Fields use ordinary spaces or tabs. Scent names are opaque non-whitespace UTF-8 tokens of at most 100 Unicode scalar values; left is a decimal count from 0 to 1000, including leading zeros. Valid shelf records are supplied.

Sign in to open this exercise

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

Sign in