Skip to content

Canonicalize all_equal_value's error #1032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

phimuemue
Copy link
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.

Copy link

codecov bot commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 93.80%. Comparing base (6814180) to head (84b2e56).
Report is 149 commits behind head on master.

Files with missing lines Patch % Lines
src/all_equal_value_err.rs 0.00% 9 Missing ⚠️
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.
📢 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
Member Author

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

* 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 84b2e56 to d7ab4e7 Compare August 3, 2025 17:58
@phimuemue
Copy link
Member Author

Rebased against our main branch.

@phimuemue phimuemue requested a review from jswrenn August 4, 2025 18:13
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