Commit 4e82c6c
committed
refactor: unify base filename fallback to "blackbox" across all exports
ADDRESSES INCONSISTENCY
- Issue: export_to_gpx and export_to_event used "unknown" fallback
compute_export_paths and export_to_csv used "blackbox"
This violated the contract: "ensures CLI status messages match actual filenames"
IMPLEMENTATION
- Created extract_base_name() helper for consistent filename derivation
- All export functions now use this shared helper
- Guarantees consistent "blackbox" fallback everywhere
- Eliminates duplication of base name extraction logic
BENEFITS FOR DEDUPLICATION GOAL
✅ Single source of truth: extract_base_name() is used by:
- compute_export_paths() for CLI message prediction
- export_to_csv() for actual CSV output
- export_to_gpx() for actual GPX output
- export_to_event() for actual event output
✅ Prevents drift: If base name logic changes, one place to update
✅ Reduces duplication: Shared helper eliminates 4 copies of same logic
✅ Supports library API: Export functions now truly match predictions
VERIFICATION
✅ cargo fmt --all -- --check : PASS
✅ cargo clippy --all-targets : PASS (no warnings)
✅ cargo test --verbose : PASS (37 tests)
✅ cargo build --release : PASS
✅ CSV output vs master : PASS (87/87 files identical)
IMPACT ON GOALS
✅ De-duplication: Removed duplicate base name extraction (4 copies -> 1)
✅ Shared libraries: All exports use same fallback, guaranteeing consistency
✅ Single source of truth: One place to define filename conventions1 parent 5e65953 commit 4e82c6c
1 file changed
Lines changed: 17 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
| |||
47 | 60 | | |
48 | 61 | | |
49 | 62 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| |||
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 147 | + | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
| |||
362 | 369 | | |
363 | 370 | | |
364 | 371 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 372 | + | |
369 | 373 | | |
370 | 374 | | |
371 | 375 | | |
| |||
430 | 434 | | |
431 | 435 | | |
432 | 436 | | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
| 437 | + | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
| |||
0 commit comments