Skip to content

Canonicalize all_equal_value's error#1032

Merged
phimuemue merged 3 commits into
rust-itertools:masterfrom
phimuemue:all_equal_value_error
May 19, 2026
Merged

Canonicalize all_equal_value's error#1032
phimuemue merged 3 commits into
rust-itertools:masterfrom
phimuemue:all_equal_value_error

Conversation

@phimuemue
Copy link
Copy Markdown
Member

Similar to exactly_one_error's error type, all_equal_value's error type now implements std::error::Error. (I saw the discrepancy because exactly_one_error works with anyhow, whereas all_equal_value does 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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2025

Codecov Report

❌ Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.92%. Comparing base (6814180) to head (54edb63).
⚠️ Report is 202 commits behind head on master.

Files with missing lines Patch % Lines
src/all_equal_value_err.rs 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1032      +/-   ##
==========================================
- Coverage   94.38%   93.92%   -0.46%     
==========================================
  Files          48       52       +4     
  Lines        6665     6638      -27     
==========================================
- Hits         6291     6235      -56     
- Misses        374      403      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@phimuemue
Copy link
Copy Markdown
Member Author

Checks fail because Display implementation is not covered, similar to the existing ExactlyOneError.

Comment thread src/all_equal_value_err.rs Outdated
@phimuemue phimuemue force-pushed the all_equal_value_error branch from 84b2e56 to d7ab4e7 Compare August 3, 2025 17:58
@phimuemue
Copy link
Copy Markdown
Member Author

Rebased against our main branch.

@phimuemue phimuemue requested a review from jswrenn August 4, 2025 18:13
@jswrenn
Copy link
Copy Markdown
Member

jswrenn commented May 19, 2026

@phimuemue Can you rebase + add an entry to the changelog? Since we're cutting a breaking release anyways, I'd like to include this.

@phimuemue
Copy link
Copy Markdown
Member Author

@phimuemue Can you rebase + add an entry to the changelog? Since we're cutting a breaking release anyways, I'd like to include this.

I tried via the web UI, so I'm not sure if it worked. If not, I'll try to get back to this this evening.

@jswrenn
Copy link
Copy Markdown
Member

jswrenn commented May 19, 2026

Thanks! Feel free to hit the merge button once the CHANGELOG has an entry for this. :-)

Are you at RustWeek by any chance?

phimuemue added 3 commits May 19, 2026 11:36
* Similar to ExactlyOneError.
* Use [Item; 2] instead of (Item, Item), because they have the same type and arrays are friendler wrt iteration.
@phimuemue phimuemue force-pushed the all_equal_value_error branch from 5d276f7 to 54edb63 Compare May 19, 2026 09:38
@phimuemue phimuemue added this pull request to the merge queue May 19, 2026
Merged via the queue into rust-itertools:master with commit 12b6ec6 May 19, 2026
12 of 14 checks passed
@phimuemue phimuemue deleted the all_equal_value_error branch May 19, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants