Fix clippy warnings and fmt issues to pass CI
All checks were successful
CI / Format (push) Successful in 23s
CI / Clippy (push) Successful in 2m50s
CI / Security Audit (push) Has been skipped
CI / Tests (push) Has been skipped
CI / Format (pull_request) Successful in 2s
CI / Clippy (pull_request) Successful in 2m48s
CI / Security Audit (pull_request) Has been skipped
CI / Tests (pull_request) Has been skipped

Replace expect/unwrap calls with safe alternatives, add Default impls
for parser structs and Toasts, fix redundant closures, collapse nested
ifs, remove unused import, and allow recursive-only-self/too-many-args
lints in compliance-graph.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-03-06 22:43:44 +01:00
parent a22cf1595f
commit ea2a9e8a1d
17 changed files with 73 additions and 44 deletions

View File

@@ -307,8 +307,7 @@ pub async fn delete_repository(
Extension(agent): AgentExt,
Path(id): Path<String>,
) -> Result<Json<serde_json::Value>, StatusCode> {
let oid =
mongodb::bson::oid::ObjectId::parse_str(&id).map_err(|_| StatusCode::BAD_REQUEST)?;
let oid = mongodb::bson::oid::ObjectId::parse_str(&id).map_err(|_| StatusCode::BAD_REQUEST)?;
let db = &agent.db;
// Delete the repository
@@ -333,10 +332,7 @@ pub async fn delete_repository(
.await;
let _ = db.graph_nodes().delete_many(doc! { "repo_id": &id }).await;
let _ = db.graph_edges().delete_many(doc! { "repo_id": &id }).await;
let _ = db
.graph_builds()
.delete_many(doc! { "repo_id": &id })
.await;
let _ = db.graph_builds().delete_many(doc! { "repo_id": &id }).await;
let _ = db
.impact_analyses()
.delete_many(doc! { "repo_id": &id })