From 1377d4393502e3abd30c3341bd673cad6fc73ba1 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Thu, 5 Feb 2026 20:49:17 +0000 Subject: [PATCH] fix: resolve clippy warnings for dead field and struct prefix - Remove unused passkey_name from RegisterStartRequest (only used in RegisterFinishRequest) - Rename AiUsageView fields from total_calls/total_tokens/total_cost to calls/tokens/cost --- src/application/routes/api/webauthn.rs | 1 - src/application/routes/app/account.rs | 12 ++++++------ templates/pages/account.html | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/application/routes/api/webauthn.rs b/src/application/routes/api/webauthn.rs index e205c81..0a8ddbf 100644 --- a/src/application/routes/api/webauthn.rs +++ b/src/application/routes/api/webauthn.rs @@ -25,7 +25,6 @@ const SESSION_COOKIE_NAME: &str = "brewlog_session"; pub struct RegisterStartRequest { pub token: String, pub display_name: String, - pub passkey_name: String, } #[derive(Serialize)] diff --git a/src/application/routes/app/account.rs b/src/application/routes/app/account.rs index 4a041ef..4bf4778 100644 --- a/src/application/routes/app/account.rs +++ b/src/application/routes/app/account.rs @@ -14,9 +14,9 @@ use crate::application::server::AppState; #[derive(Serialize)] pub struct AiUsageView { - pub total_calls: i64, - pub total_tokens: String, - pub total_cost: String, + pub calls: i64, + pub tokens: String, + pub cost: String, } fn format_cost(cost: f64) -> String { @@ -133,9 +133,9 @@ pub(crate) async fn account_page( } }; let ai_usage = ai_usage.filter(|s| s.total_calls > 0).map(|s| AiUsageView { - total_calls: s.total_calls, - total_tokens: format_number(s.total_tokens), - total_cost: format_cost(s.total_cost), + calls: s.total_calls, + tokens: format_number(s.total_tokens), + cost: format_cost(s.total_cost), }); let template = AccountTemplate { diff --git a/templates/pages/account.html b/templates/pages/account.html index 0c951ce..d79d84c 100644 --- a/templates/pages/account.html +++ b/templates/pages/account.html @@ -224,15 +224,15 @@
Total Cost - {{ usage.total_cost }} + {{ usage.cost }}
API Calls - {{ usage.total_calls }} + {{ usage.calls }}
Total Tokens - {{ usage.total_tokens }} + {{ usage.tokens }}