From e5c14636a75abe1cbc67772358170bc883177004 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Wed, 25 Mar 2026 16:32:34 +0100 Subject: [PATCH] fix: avoid unwrap in MCP health check to pass clippy Co-Authored-By: Claude Opus 4.6 (1M context) --- compliance-dashboard/src/infrastructure/mcp.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compliance-dashboard/src/infrastructure/mcp.rs b/compliance-dashboard/src/infrastructure/mcp.rs index 80fedb3..60d7cd9 100644 --- a/compliance-dashboard/src/infrastructure/mcp.rs +++ b/compliance-dashboard/src/infrastructure/mcp.rs @@ -158,12 +158,17 @@ pub async fn refresh_mcp_status() -> Result<(), ServerFnError> { _ => McpServerStatus::Stopped, }; + let status_bson = match bson::to_bson(&new_status) { + Ok(b) => b, + Err(_) => continue, + }; + let _ = state .db .mcp_servers() .update_one( doc! { "_id": oid }, - doc! { "$set": { "status": bson::to_bson(&new_status).unwrap(), "updated_at": Utc::now().to_rfc3339() } }, + doc! { "$set": { "status": status_bson, "updated_at": Utc::now().to_rfc3339() } }, ) .await; }