Many errors#5
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends errortools with an alloc-enabled aggregated error type (ManyErrors) for collecting multiple context-tagged errors, while also refactoring and centralizing test fixtures/strategies to reduce per-module test boilerplate.
Changes:
- Add
ManyErrors+Listingformatting strategy (alloc feature) for aggregated, context-tagged iterator/fold errors. - Introduce
AsDisplaysentinelFormatstrategy to delegate formatting to a value’sDisplay. - Consolidate test fixtures/format strategies into
src/tests.rsand update existing unit tests accordingly.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/with_context.rs | Renames the format type parameter and updates tests to use shared fixtures. |
| src/tree.rs | Updates tests to use shared Inner fixture and minor naming tweaks. |
| src/tests.rs | New shared test fixtures and reusable Format strategies. |
| src/suggestion.rs | Reworks tests around the “Suggest is not delegated” invariant using shared fixtures. |
| src/oneline.rs | Updates tests to reuse shared Arrow formatter and shared fixtures. |
| src/many_errors/mod.rs | New alloc-only ManyErrors aggregate error type + Listing formatting strategy. |
| src/many_errors/iter.rs | New iterator + collection (FromIterator/Extend) integrations for ManyErrors. |
| src/main_result.rs | Updates tests to use shared fixtures instead of local test-only error types. |
| src/lib.rs | Adds alloc support + exports, introduces AsDisplay, and switches tests to src/tests.rs. |
| src/add.rs | Updates tests to use shared fixtures. |
| Cargo.toml | Adds alloc feature and makes std imply alloc. |
| .github/workflows/ci.yml | Expands CI matrix to include --no-default-features --features alloc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| impl<C, E, WithContextFormat> ManyErrors<C, E, WithContextFormat> { | ||
| /// Returns an iterator over references to each recorded [`WithContext`]. | ||
| pub fn iter(&self) -> Iter<'_, C, E, WithContextFormat> { |
Comment on lines
+205
to
+206
| /// Renders as a branching Unicode tree with a count header (same as default [`Display`]). | ||
| pub fn tree(&self) -> crate::Formatted<&Self, Tree> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.