style: cargo fmt on today's new code (883/884/886/opus-pin)

The mergemaster gates run rustfmt and rejected 864's merge because
several files I added/touched in master today had not been fmt'd.
Six files affected, mostly trivial line-wrapping nits. Fixes the
formatting gate for the next 864 merge attempt.
This commit is contained in:
dave
2026-04-30 22:15:37 +00:00
parent 66f340a7a3
commit 1251b869a6
6 changed files with 30 additions and 41 deletions
+1 -5
View File
@@ -61,11 +61,7 @@ pub async fn mcp_get_handler() -> Response {
/// `POST /mcp` — JSON-RPC 2.0 entry point for `initialize`, `tools/list`,
/// `tools/call`, and `notifications/*`.
#[handler]
pub async fn mcp_post_handler(
req: &Request,
body: Body,
ctx: Data<&Arc<AppContext>>,
) -> Response {
pub async fn mcp_post_handler(req: &Request, body: Body, ctx: Data<&Arc<AppContext>>) -> Response {
let content_type = req.header("content-type").unwrap_or("");
if !content_type.is_empty() && !content_type.contains("application/json") {
return json_response(JsonRpcResponse::error(
+12 -9
View File
@@ -366,12 +366,8 @@ async fn run_script_tool(
// When verbose, fall back to the legacy truncated output so callers
// who actually want raw text still get a bounded payload.
let mut payload = build_diagnostic_response(
result.status.success(),
exit_code,
&combined,
verbose,
);
let mut payload =
build_diagnostic_response(result.status.success(), exit_code, &combined, verbose);
if verbose {
payload["output"] = serde_json::json!(truncate_output(&combined, MAX_OUTPUT_LINES));
}
@@ -715,7 +711,10 @@ mod tests {
"last error code should be parsed"
);
let summary = parsed["summary"].as_str().expect("summary string");
assert!(summary.contains("150 error"), "summary mentions error count: {summary}");
assert!(
summary.contains("150 error"),
"summary mentions error count: {summary}"
);
// Default response should be small even with 150 errors.
assert!(
result.len() < 50_000,
@@ -724,9 +723,13 @@ mod tests {
);
// Verbose mode: raw output is included.
let result_v = tool_run_check(&json!({"verbose": true}), &ctx).await.unwrap();
let result_v = tool_run_check(&json!({"verbose": true}), &ctx)
.await
.unwrap();
let parsed_v: serde_json::Value = serde_json::from_str(&result_v).unwrap();
let output = parsed_v["output"].as_str().expect("verbose includes output");
let output = parsed_v["output"]
.as_str()
.expect("verbose includes output");
assert!(output.contains("error[E1]"), "verbose contains first line");
assert!(output.contains("error[E150]"), "verbose contains last line");
}