refactor: Split core traversal impls into modules#21
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the traversable crate’s internal built-in Traversable/TraversableMut implementations by moving them out of lib.rs into dedicated impls/* modules, keeping the public API surface and traversal behavior unchanged while improving maintainability.
Changes:
- Removed the inline built-in impl modules/macros from
traversable/src/lib.rs. - Added focused implementation modules for tuples, trivial primitives, and std types under
traversable/src/impls/. - Centralized shared helper macros (
blank_traverse_impl!,trivial_traverse_impl!) intraversable/src/impls/mod.rsand wired module inclusion via feature flags.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| traversable/src/lib.rs | Removes inlined built-in impl modules/macros and keeps the crate’s core traits/public API focused. |
| traversable/src/impls/mod.rs | Defines shared traversal helper macros and declares impl submodules (feature-gated where appropriate). |
| traversable/src/impls/tuple.rs | Rehomes tuple Traversable/TraversableMut implementations. |
| traversable/src/impls/trivial.rs | Rehomes primitive/unit trivial traversal implementations, preserving traverse-trivial gating. |
| traversable/src/impls/std_primary.rs | Rehomes std “primary” type implementations (e.g., String) with traverse-std gating. |
| traversable/src/impls/std_container.rs | Rehomes std container implementations (iterable containers, Box, Arc, locks, Cell, etc.). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
lib.rsinto focusedimplsmodules.impls/mod.rs.Tests
cargo x lint --fixcargo x test --no-capture