From 153870ec3a874476cd48418d6c03a95d51f6c22a Mon Sep 17 00:00:00 2001 From: iris Date: Fri, 5 Jun 2026 20:11:46 +0200 Subject: [PATCH] test: drop unnecessary Result wrap in bash status test helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clippy::unnecessary_wraps — the helper always returns Ok. Build the DaemonResponse directly and wrap with Ok() at the call sites. Fixes the CI clippy failure on this PR. --- hive-bash-mcp/src/bin/mcp.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hive-bash-mcp/src/bin/mcp.rs b/hive-bash-mcp/src/bin/mcp.rs index c7c5b23e..544d39d9 100644 --- a/hive-bash-mcp/src/bin/mcp.rs +++ b/hive-bash-mcp/src/bin/mcp.rs @@ -261,30 +261,29 @@ async fn main() -> Result<()> { #[cfg(test)] mod status_hint_tests { use super::{BASH_IDLE_WAIT_HINT, render_bash_status}; - use anyhow::Result; use hive_bash_mcp::protocol::DaemonResponse; - fn ok(status: &str) -> Result { - Ok(DaemonResponse::Ok { + fn status_resp(status: &str) -> DaemonResponse { + DaemonResponse::Ok { payload: serde_json::json!({ "status": status, "started_at": 1 }), - }) + } } #[test] fn running_task_after_wait_appends_idle_hint() { - let out = render_bash_status("t1", ok("running"), true); + let out = render_bash_status("t1", Ok(status_resp("running")), true); assert!(out.contains(BASH_IDLE_WAIT_HINT)); } #[test] fn running_task_without_wait_has_no_hint() { - let out = render_bash_status("t1", ok("running"), false); + let out = render_bash_status("t1", Ok(status_resp("running")), false); assert!(!out.contains(BASH_IDLE_WAIT_HINT)); } #[test] fn finished_task_after_wait_has_no_hint() { - let out = render_bash_status("t1", ok("done"), true); + let out = render_bash_status("t1", Ok(status_resp("done")), true); assert!(!out.contains(BASH_IDLE_WAIT_HINT)); } }