Extract step increment logic from Continue pattern into reusable Box:
New Module:
- step_calculator.rs (161 lines)
- extract_linear_increment(): Detect i + const patterns
- calculate_step_difference(): Compute step delta
- 6 comprehensive unit tests (100% coverage)
Changes:
- continue_pattern.rs: Use StepCalculator instead of local function
- Removed extract_add_i_const() (20 lines)
- Cleaner separation of concerns
- mod.rs: Register step_calculator module
Benefits:
- Reusability: Available for ContinueReturn and future patterns
- Testability: Independent pure functions with unit tests
- Extensibility: Easy to add i *= 2 support later
- SSOT: Single source of truth for step increment logic
Code Metrics:
- continue_pattern.rs: 321 → 305 lines (5% reduction)
- New tests: +6 (993 total passed)
- Complexity: Reduced (pure function extraction)
Tests: 993 passed (no regression)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>