Skip to content

Implement Iterator::size_hint() in some cases.#102

Merged
kpreid merged 1 commit intomainfrom
sizehint2
Mar 14, 2026
Merged

Implement Iterator::size_hint() in some cases.#102
kpreid merged 1 commit intomainfrom
sizehint2

Conversation

@kpreid
Copy link
Owner

@kpreid kpreid commented Mar 14, 2026

The size hint is now calculated whenever feasible, and is exact for:

  • Structs with 0 or 1 fields.
  • Enums, when all remaining variants are fieldless.
  • Exhausted enum iterators (trivially).

The size hint is now calculated whenever feasible, and is exact for:

* Structs with 0 or 1 fields.
* Enums, when all remaining variants are fieldless.
* Exhausted enum iterators (trivially).
@kpreid kpreid merged commit 7d22da1 into main Mar 14, 2026
11 checks passed
@kpreid kpreid deleted the sizehint2 branch March 14, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant