Files
foxhunt/agent_437_map_err_fixes.txt
jgrusewski 030a15ee05 🔧 Emergency Fix: Resolve catastrophic _i32 suffix corruption (463→0 errors)
- Fixed systematic array indexing corruption: [0_i32] → [0]
- Fixed numeric literal suffixes across 835 files
- Fixed iterator patterns on RwLockReadGuard (.iter() required)
- Fixed float type annotations (365.25_f64 for sqrt)
- Fixed missing semicolons in position manager
- Fixed reference dereferencing in data loader

Root cause: Mass refactoring incorrectly added _i32 suffixes to array indices
Impact: Complete compilation failure (463 errors)
Resolution: Automated regex + targeted fixes
Result: 100% compilation success (0 errors)

Validated: cargo check --workspace passes
Ready for: Production deployment
2025-10-10 23:05:26 +02:00

59 lines
1.9 KiB
Plaintext

Agent 437 - Wave 7 Phase 3: Fix map_err wildcard patterns
## Task
Fix clippy::map_err_ignore errors by replacing .map_err(|_| ...) with .map_err(|e| ... format!("{}", e) ...)
## Execution
### Files Fixed
- common/src/types.rs: 7 errors fixed
### Changes Made
1. Line 1869: Fill quantity overflow error - capture and include error in message
2. Line 2471: Price parsing error - capture and include parse error
3. Line 2749: Decimal to Quantity conversion - capture and include conversion error
4. Line 2883: Quantity parsing error - capture and include parse error
5. Line 2925: Decimal to f64 conversion - capture and include conversion error
6. Line 3071: NUMERIC to Price conversion (SQLx) - capture and include TryFrom error
7. Line 3108: NUMERIC to Quantity conversion (SQLx) - capture and include TryFrom error
### Pattern Applied
All fixes followed the same pattern:
```rust
// Before:
.map_err(|_| SomeError { message: "fixed message".to_owned() })
// After:
.map_err(|e| SomeError { message: format!("fixed message: {}", e) })
```
## Verification
### Before
```bash
$ cargo clippy -p common --lib -- -D clippy::map_err_ignore 2>&1 | grep "^error:" | wc -l
7
```
### After
```bash
$ cargo clippy -p common --lib -- -D clippy::map_err_ignore 2>&1 | grep "^error:" | wc -l
0
```
## Results
✅ **SUCCESS**: All 7 map_err_ignore errors in common crate eliminated
✅ **VERIFIED**: cargo clippy -p common --lib passes with -D clippy::map_err_ignore
✅ **ERROR COUNT**: 7 → 0 (100% reduction in common crate)
## Notes
- The workspace has compilation errors in services/stress_tests preventing full workspace clippy scan
- Other crates (trading_engine, adaptive-strategy) have additional map_err_ignore violations
- The common crate is now fully compliant with clippy::map_err_ignore
- All error messages now preserve the original error context
## Files Modified
1. /home/jgrusewski/Work/foxhunt/common/src/types.rs (7 fixes applied)