- Split monolithic src/lib.rs (~640 lines) into 7 sub-modules: types.rs, context.rs, user_data.rs, translate.rs, http.rs, csv_util.rs, test_utils.rs - Add configurable --output-dir CLI option for CSV output files - Implement atomic file writes (write-to-temp + rename) for all CSVs - Change compute_car_counts() to return CarCounts directly (not Result) - Add test-utils feature gate for shared test helpers - Add HTTP mock tests with mockito (6 tests) - Add proptest tests for compute_car_counts (3 property tests) - Update integration tests to use shared test utilities - Update documentation (API.md, ARCHITECTURE.md, DATA_STRUCTURES.md)
18 lines
686 B
Rust
18 lines
686 B
Rust
//! Details command implementation.
|
|
//!
|
|
//! Generates details.csv with comprehensive timing data for all
|
|
//! track/condition/RQ combinations.
|
|
|
|
use top_drives::AppError;
|
|
|
|
use crate::commands::{load_my_cars_or_warn, run_analysis};
|
|
use crate::output::write_details_csv;
|
|
|
|
/// Executes the details command: generates details.csv.
|
|
pub async fn run_details(my_cars_path: &str, cars_db_path: &str, times_dir: &str, output_dir: &str) -> Result<(), AppError> {
|
|
let my_data = load_my_cars_or_warn(my_cars_path)?;
|
|
let (ctx, _counts) = run_analysis(&my_data.owned, cars_db_path, times_dir).await?;
|
|
write_details_csv(output_dir, &ctx)?;
|
|
println!("Written: details.csv");
|
|
Ok(())
|
|
}
|