-
Notifications
You must be signed in to change notification settings - Fork 328
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
base: master
Are you sure you want to change the base?
Conversation
* Similar to ExactlyOneError. * Use [Item; 2] instead of (Item, Item), because they have the same type and arrays are friendler wrt iteration.
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:
|
Checks fail because |
src/all_equal_value_err.rs
Outdated
use std::error::Error; | ||
use std::fmt::{Debug, Display, Formatter, Result as FmtResult}; | ||
|
||
/// Value returned for the error case of `Itertools::all_equal_value()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this an intradoc link:
/// Value returned for the error case of `Itertools::all_equal_value()`. | |
/// Value returned for the error case of [`Itertools::all_equal_value]`. |
you might need to add a #[cfg(doc)] use crate::Itertools;
to the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Similar to
exactly_one_error
's error type,all_equal_value
's error type now implementsstd::error::Error
. (I saw the discrepancy becauseexactly_one_error
works withanyhow
, whereasall_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.