From c2c07db34a414e0c95a997ef7efc31d24ebba80b Mon Sep 17 00:00:00 2001 From: jwinterm Date: Thu, 13 Aug 2026 10:37:13 -0400 Subject: [PATCH] chore: cargo fmt with rustfmt 1.9.0 (repo-wide) CI gates on cargo fmt --all -- --check and it was already failing on main before this branch: rustfmt 1.9.0 reformats three call chains that an older rustfmt left alone. Same housekeeping as 586d29e. --- src/api/premium.rs | 12 ++++++++++-- src/core/session.rs | 6 +++++- src/infra/db/login_events.rs | 4 +++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/api/premium.rs b/src/api/premium.rs index 0685664..6bc0080 100644 --- a/src/api/premium.rs +++ b/src/api/premium.rs @@ -268,7 +268,11 @@ pub async fn activate( // Just activated, so general posting is permitted regardless of policy; still // report the allowlist bit truthfully. - let npub = state.db.get_user_by_id(user_id).await?.and_then(|u| u.nostr_pubkey); + let npub = state + .db + .get_user_by_id(user_id) + .await? + .and_then(|u| u.nostr_pubkey); let (write_allowlisted, _) = general_posting_rights(&state, npub.as_deref()); Ok(Json(StatusResp { active: true, @@ -297,7 +301,11 @@ pub async fn status( let user_id = extract_user_id_from_token(&state, &headers).await?; let until = state.db.get_premium_until(user_id).await?; let active = until.map(|u| u > chrono::Utc::now()).unwrap_or(false); - let npub = state.db.get_user_by_id(user_id).await?.and_then(|u| u.nostr_pubkey); + let npub = state + .db + .get_user_by_id(user_id) + .await? + .and_then(|u| u.nostr_pubkey); let (write_allowlisted, can_general) = general_posting_rights(&state, npub.as_deref()); Ok(Json(StatusResp { active, diff --git a/src/core/session.rs b/src/core/session.rs index f354bec..1bdd9b7 100644 --- a/src/core/session.rs +++ b/src/core/session.rs @@ -239,7 +239,11 @@ impl SessionManager { Ok(TokenInfo { user_id, platform: data.claims.platform, - session_id: data.claims.sid.as_deref().and_then(|s| Uuid::parse_str(s).ok()), + session_id: data + .claims + .sid + .as_deref() + .and_then(|s| Uuid::parse_str(s).ok()), }) } diff --git a/src/infra/db/login_events.rs b/src/infra/db/login_events.rs index 400ea70..22b7eb2 100644 --- a/src/infra/db/login_events.rs +++ b/src/infra/db/login_events.rs @@ -186,7 +186,9 @@ impl Database { audit_days: u64, batch: i64, ) -> Result { - let logins = self.cleanup_old_login_events(login_events_days, batch).await?; + let logins = self + .cleanup_old_login_events(login_events_days, batch) + .await?; let audits = self.cleanup_old_audit_logs(audit_days, batch).await?; let scrubbed = self.scrub_legacy_login_ip_hashes(batch).await?; if scrubbed > 0 {