-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
cleanupDead code removal and cleanupDead code removal and cleanup
Description
Problem
src/core/config.rs is 1,532 lines and serves as the central persistence layer. It contains several distinct concerns mixed together:
- Config entity trait + macro — the
entity_crud!macro and trait system - JSON pointer operations —
get_pointer,set_pointer,delete_pointer, path resolution (~200 lines) - JSON parsing utilities — type detection, merging, diffing
- File I/O — read/write JSON config files
- Entity search — fuzzy matching, array field collection
- Tests — ~300 lines
Proposed Change
Extract the JSON pointer operations into src/core/json_pointer.rs:
get_pointer()/set_pointer()/delete_pointer()- Path segment parsing and resolution
- Related helper functions
This is a self-contained, reusable piece of infrastructure that has no config-specific dependencies.
Benefits
config.rsdrops to ~1,300 lines (still large but more focused)- JSON pointer ops become independently testable and reusable
- Clearer separation: config = entity persistence, json_pointer = generic JSON path operations
Constraints
- No behavioral changes
- All existing callers continue to work (re-export from config if needed during transition)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cleanupDead code removal and cleanupDead code removal and cleanup