refactor: modular architecture with unified error handling and DashMap concurrency

- Break monolithic records.rs into commands/, output/, parsing/ modules
- Add lib.rs with shared types (AppError, Car, BestCarRecord, etc.)
- Replace Arc<Mutex<HashMap>> with DashMap for concurrent access
- Add unified AppError enum with thiserror
- Add configurable CLI paths (--my-cars, --cars-db, --times-dir, --tracks-db)
- Add serde deserialization for Car struct
- Add CSV escaping for fields with commas/quotes/newlines
- Fix track name splitting: split_once -> rsplit_once for _a handling
- Add integration tests, proptest property-based tests, and unit tests
- Add rustfmt.toml configuration
- Update documentation (API, ARCHITECTURE, DATA_STRUCTURES, README)
This commit is contained in:
Jan-Peter von Hunnius 2026-05-08 16:19:01 +02:00
parent 9d57b18a4e
commit a9a46ee551
24 changed files with 3541 additions and 1470 deletions

View file

@ -282,10 +282,11 @@ top_drives/
### Dependencies
- **reqwest**: HTTP client for data fetching
- **serde_json**: JSON parsing and serialization
- **tokio**: Asynchronous runtime
- **serde** / **serde_json**: JSON parsing and serialization (with `serde::Deserialize` derive for `Car`)
- **tokio**: Asynchronous runtime (rt-multi-thread, macros, fs, sync, io-util)
- **futures**: Async utility combinators
- **once_cell**: Lazy static initialization
- **clap**: CLI argument parsing (with derive macros)
- **thiserror**: Ergonomic error type definitions
## 🔧 Development
@ -325,6 +326,7 @@ struct BestCarRecord {
config: String, // Tune configuration
time: f64, // Track time
owned: bool, // Whether you own this car
prize: bool, // Whether this is a prize car
guid: String, // Game identifier
}
```