Commit 6619f13
committed
Extract validation and debugging utilities to separate module
- Create rust/src/validation.rs with all validation and debugging methods
- Move check_invariants, validate, print_node_chain, slice, leaf_sizes (~322 lines)
- Reduce lib.rs from 948 to 626 lines (additional 34% reduction)
- Total reduction: 1,106 lines removed from lib.rs (64% total reduction)
- Update MODULARIZATION_PLAN_REVISED.md with progress metrics
Extracted validation methods:
- check_invariants: Basic invariant checking
- check_invariants_detailed: Detailed error reporting
- validate: Alias for detailed checking
- print_node_chain: Tree structure debugging
- slice: Extract all key-value pairs for testing
- leaf_sizes: Extract leaf node sizes for analysis
- validate_for_operation: Pre/post operation validation
Benefits:
- All validation logic isolated in dedicated module
- Easier to maintain and extend validation rules
- Clear separation between tree operations and validation
- lib.rs now 64% smaller, approaching target of ~150 lines
Remaining: Extract tree structure operations and range queries1 parent 74bfe29 commit 6619f13
File tree
3 files changed
+378
-335
lines changed- rust
- src
3 files changed
+378
-335
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
572 | 579 | | |
0 commit comments