Fix P1 Rust: all clippy warnings resolved, all tests passing
Some checks failed
CI — P1 Route (Rust) / test (push) Has been cancelled

- Fixed struct field references (_org_id, _config) in constructors
- Added chrono::Weekday import in test module
- cargo clippy --workspace -- -D warnings: CLEAN
- cargo test --workspace: 5/5 passing
This commit is contained in:
2026-03-01 17:28:41 +00:00
parent 4b6292e0c3
commit 0a3173c6a9
3 changed files with 5008 additions and 2 deletions

5005
products/01-llm-cost-router/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,7 @@ async fn main() -> anyhow::Result<()> {
)), )),
pg_pool, pg_pool,
ts_pool, ts_pool,
config: config.clone(), _config: config.clone(),
}); });
let app = create_api_router(state); let app = create_api_router(state);

View File

@@ -177,7 +177,7 @@ async fn generate_digest(ts_pool: &PgPool, org_id: Uuid, org_name: &str) -> anyh
let savings_pct = if summary.1 > 0.0 { (summary.3 / summary.1) * 100.0 } else { 0.0 }; let savings_pct = if summary.1 > 0.0 { (summary.3 / summary.1) * 100.0 } else { 0.0 };
Ok(DigestData { Ok(DigestData {
org_id, _org_id: org_id,
org_name: org_name.to_string(), org_name: org_name.to_string(),
total_requests: summary.0, total_requests: summary.0,
total_cost_original: summary.1, total_cost_original: summary.1,
@@ -201,6 +201,7 @@ async fn generate_digest(ts_pool: &PgPool, org_id: Uuid, org_name: &str) -> anyh
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use chrono::Weekday;
#[test] #[test]
fn next_monday_from_wednesday() { fn next_monday_from_wednesday() {