Expand description
Deterministic ordering for GroupedQuantity.
Everything that renders or serialises a grouped quantity goes through
ordered_components or grouped_quantity_fmt, so the human table,
Markdown, JSON, YAML, LaTeX, Typst, schema.org and library outputs all
agree on one order.
That ordering is a published contract, not a local convention: cookcli-core
renders its shopping list through these functions, and the snapshot tests
pinning the order live in CookCLI, two crates downstream. Changing it
changes their output.
Functions§
- grouped_
quantity_ fmt - Render
groupedthe way its ownDisplayimpl does — the components joined with", "— but inordered_componentsorder. - ordered_
components - The components of
grouped, ordered by unit name, the unitless component first.