Repository navigation
refactor: split id_tracker_base.rs into a module - #8804
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe PR removes a single-file id-tracker base and replaces it with a modular layout under Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
lib/segment/src/id_tracker/id_tracker_base/point_mappings_ref.rs (1)
80-122: Optional: align receiver types for the_visiblevariants.
iter_internal,iter_from, anditer_random(lines 25–63) takeself, but their_visiblecounterparts take&self. SincePointMappingsRefEnum<'a>isCopy, takingselfwould let the returned iterators carry the full'alifetime instead of being narrowed to'_of&self, matching the non-visible variants. Pure code move here, so feel free to defer — flagging only as a follow-up cleanup opportunity.♻️ Suggested signature alignment
- pub fn iter_internal_visible( - &self, - deferred_internal_id: Option<PointOffsetType>, - ) -> Box<dyn Iterator<Item = PointOffsetType> + '_> { + pub fn iter_internal_visible( + self, + deferred_internal_id: Option<PointOffsetType>, + ) -> Box<dyn Iterator<Item = PointOffsetType> + 'a> {(and similarly for
iter_from_visible/iter_random_visible)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/segment/src/id_tracker/id_tracker_base/point_mappings_ref.rs` around lines 80 - 122, The `_visible` methods currently take `&self` which narrows the returned iterator lifetime; change the receivers to take `self` for iter_internal_visible, iter_from_visible, and iter_random_visible so they match the non-visible variants (iter_internal, iter_from, iter_random) and allow the iterators to carry the full `'a` lifetime; update the method signatures to consume `self` and keep the existing match/logic and closures (move patterns) intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@lib/segment/src/id_tracker/id_tracker_base/point_mappings_ref.rs`:
- Around line 80-122: The `_visible` methods currently take `&self` which
narrows the returned iterator lifetime; change the receivers to take `self` for
iter_internal_visible, iter_from_visible, and iter_random_visible so they match
the non-visible variants (iter_internal, iter_from, iter_random) and allow the
iterators to carry the full `'a` lifetime; update the method signatures to
consume `self` and keep the existing match/logic and closures (move patterns)
intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 522ef13e-b7e0-423d-a879-697e8eec4c14
📒 Files selected for processing (5)
lib/segment/src/id_tracker/id_tracker_base.rslib/segment/src/id_tracker/id_tracker_base/mod.rslib/segment/src/id_tracker/id_tracker_base/point_mappings_ref.rslib/segment/src/id_tracker/id_tracker_base/tracker_enum.rslib/segment/src/id_tracker/id_tracker_base/trait_def.rs
💤 Files with no reviewable changes (1)
- lib/segment/src/id_tracker/id_tracker_base.rs
Break the 501-line file into a directory module with logically separated components: trait_def.rs (IdTracker trait + constants), point_mappings_ref.rs (PointMappingsRefEnum + PointMappingsGuard), tracker_enum.rs (IdTrackerEnum + its IdTracker impl), and mod.rs (re-exports). No logic changes. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
76f3cc7 to
3cb63ec
Compare
Break the 501-line file into a directory module with logically separated components: trait_def.rs (IdTracker trait + constants), point_mappings_ref.rs (PointMappingsRefEnum + PointMappingsGuard), tracker_enum.rs (IdTrackerEnum + its IdTracker impl), and mod.rs (re-exports). No logic changes. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
id_tracker_base.rsinto a directory module, mirroring the recentmutable_id_trackerrefactor (refactor: split mutable_id_tracker.rs into a module #8795).trait_def.rsholds theIdTrackertrait and theSEED/DELETED_POINT_VERSIONconstants;point_mappings_ref.rsholdsPointMappingsRefEnumand thePointMappingsGuardself_cell;tracker_enum.rsholdsIdTrackerEnumand itsIdTrackerimpl;mod.rsjust re-exports.id_tracker/mod.rskeepspub use id_tracker_base::*;, so external imports resolve unchanged.Test plan
mold -run cargo clippy --all-targets— clean