Commit 5e65953
committed
refactor: remove unnecessary path computation from export_to_gpx early return
IMPROVES SEPARATION OF CONCERNS
- export_to_gpx() should only export data, not compute paths for messaging
- Removed unnecessary path computation when gps_coordinates is empty
- CLI already uses compute_export_paths() for message generation
- Export functions stay focused on their core responsibility
BENEFITS
- Cleaner library API: export functions don't couple to CLI messaging needs
- Better separation of concerns: path computation is CLI responsibility
- More reusable: export functions can be used by other tools without side effects
- Supports goal: Moving to shared libraries for both CLI and crate usage
IMPLEMENTATION
- Removed ~20 lines of path computation code from export_to_gpx early return
- CLI message generation unchanged (already uses compute_export_paths)
- export_to_event was already correct (had early return without path computation)
VERIFICATION
✅ cargo fmt --all -- --check : PASS
✅ cargo clippy --all-targets : PASS
✅ cargo test --verbose : PASS (37 tests)
✅ cargo build --release : PASS
✅ CSV output vs master : PASS (87/87 files identical)
✅ GPX/event messaging : PASS (messages still displayed correctly)
ALIGNMENT WITH GOALS
✅ De-duplication: Further reduced code duplication
✅ Shared libraries: Export functions now cleaner library APIs
✅ Better separation: Export functions don't depend on CLI messaging1 parent 3c954cb commit 5e65953
1 file changed
Lines changed: 0 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | 362 | | |
382 | 363 | | |
383 | 364 | | |
| |||
0 commit comments