Canonicalize all_equal_value's error#1032
Open
phimuemue wants to merge 2 commits intorust-itertools:masterfrom
Open
Canonicalize all_equal_value's error#1032phimuemue wants to merge 2 commits intorust-itertools:masterfrom
all_equal_value's error#1032phimuemue wants to merge 2 commits intorust-itertools:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1032 +/- ##
==========================================
- Coverage 94.38% 93.80% -0.59%
==========================================
Files 48 51 +3
Lines 6665 6202 -463
==========================================
- Hits 6291 5818 -473
- Misses 374 384 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
|
Checks fail because |
jswrenn
requested changes
Jun 10, 2025
* Similar to ExactlyOneError. * Use [Item; 2] instead of (Item, Item), because they have the same type and arrays are friendler wrt iteration.
84b2e56 to
d7ab4e7
Compare
Member
Author
|
Rebased against our main branch. |
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.
Similar to
exactly_one_error's error type,all_equal_value's error type now implementsstd::error::Error. (I saw the discrepancy becauseexactly_one_errorworks withanyhow, whereasall_equal_valuedoes not.)Since I had to introduce a new type anyways, I converted from
(Item, Item)to[Item; 2]. I suggest we generally lean towards arrays instead of tuples if the components have the same type.