refactor(clippy): fix the never-loop error and clear all lint warnings
`cargo clippy --all-targets` was failing on a deny-by-default `never_loop` in the analysis SSE handler (the `loop` always returned on the first iteration — the stream `unfold` already re-enters per event), plus ~28 warnings. All resolved with no behaviour change: - admin/analysis SSE: drop the dead `loop` wrapper. - app: match port literals directly instead of `if p == 80` guards. - repo/user: separate doc list from the following paragraphs. - repo/upload_history: `sort_by_key(Reverse(..))` over `sort_by`. - crawler/nav test: construct the error directly (no `unwrap_err` on a literal `Err`). - test helpers: build configs via struct-update syntax instead of `Default::default()` + field reassignment; add a type alias for a complex audit-row tuple. - plus the mechanical `deref`/etc. fixes from `cargo clippy --fix`. Note: not running `cargo fmt` — the backend uses a consistent hand-formatted style that differs from rustfmt-default across ~110 files, so a blanket reformat would be pure churn. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -381,10 +381,11 @@ async fn delete_writes_audit_row(pool: PgPool) {
|
||||
.unwrap();
|
||||
assert_eq!(resp.status(), StatusCode::NO_CONTENT);
|
||||
|
||||
let rows: Vec<(Option<Uuid>, String, String, Option<Uuid>, serde_json::Value)> =
|
||||
sqlx::query_as(
|
||||
"SELECT actor_user_id, action, target_kind, target_id, payload FROM admin_audit",
|
||||
)
|
||||
// (actor_user_id, action, target_kind, target_id, payload)
|
||||
type AuditRow = (Option<Uuid>, String, String, Option<Uuid>, serde_json::Value);
|
||||
let rows: Vec<AuditRow> = sqlx::query_as(
|
||||
"SELECT actor_user_id, action, target_kind, target_id, payload FROM admin_audit",
|
||||
)
|
||||
.fetch_all(&pool)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user