-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generalise compare_fields to work with iterators (#4823)
## Proposed Changes Add `compare_fields(as_iter)` as a field attribute to `compare_fields_derive`. This allows any iterable type to be compared in the same as a slice (by index). This is forwards-compatible with tree-states types like `List` and `Vector` which can not be cast to slices.
- Loading branch information
1 parent
1b4545c
commit 463e62e
Showing
4 changed files
with
40 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ version = "0.2.0" | |
authors = ["Paul Hauner <[email protected]>"] | ||
edition = { workspace = true } | ||
|
||
[dependencies] | ||
itertools = { workspace = true } | ||
|
||
[dev-dependencies] | ||
compare_fields_derive = { workspace = true } | ||
|
||
|
This file contains 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
This file contains 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