Skip to content

refactor!: move raise_all to IteratorExt::raise - #56

Open
tisonkun wants to merge 3 commits into
mainfrom
codex/iterator-ext-raise
Open

refactor!: move raise_all to IteratorExt::raise#56
tisonkun wants to merge 3 commits into
mainfrom
codex/iterator-ext-raise

Conversation

@tisonkun

@tisonkun tisonkun commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add IteratorExt::raise(parent) for iterators whose items convert into Exn.
  • Replace the public Exn::raise_all entry point with the iterator extension.
  • Preserve iteration order, existing exception subtrees, raw-error conversion, empty-iterator behavior, and caller locations.

Why raise

The fluent forms now read symmetrically:

child.raise(parent)
children.into_iter().raise(parent)

The iterator receiver already expresses plurality, so raise_all repeats information. collect_all would suggest collecting Result values and deciding how successes and failures interact.

This intentionally does not revive the fail-slow Iterator<Item = Result<T, E>> design from #32. That is a separate collection operation, comparable to error-stack's try_collect_reports.

Compatibility

This is a breaking API change, recorded in the changelog. The draft keeps one policy question visible for review: remove Exn::raise_all directly for the next release, as implemented here, or deprecate it for one release first.

Validation

  • cargo test --workspace
  • cargo +nightly clippy --tests --all-features --all-targets --workspace -- -D warnings
  • cargo +nightly fmt --all --check
  • taplo format --check on tracked TOML files
  • typos
  • hawkeye check

Replace the associated constructor with a fluent iterator extension while preserving child order, empty-iterator behavior, and caller locations.
@tisonkun
tisonkun marked this pull request as ready for review August 9, 2026 19:50
@tisonkun
tisonkun requested a review from andylokandy August 9, 2026 19:50
@tisonkun tisonkun changed the title refactor: move raise_all to IteratorExt::raise refactor!: move raise_all to IteratorExt::raise Aug 10, 2026
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