Skip to content

Commit a705263

Browse files
style: rustfmt lcm session handlers
1 parent f68dab9 commit a705263

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

src/mcp/tools/handlers/session.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,7 @@ fn registry_session_db_candidates(
269269
Ok(candidates)
270270
}
271271

272-
fn lcm_preflight_tool_json(
273-
project_root: Option<&Path>,
274-
args: &Value,
275-
value: &Value,
276-
) -> ToolResult {
272+
fn lcm_preflight_tool_json(project_root: Option<&Path>, args: &Value, value: &Value) -> ToolResult {
277273
if !render::wants_json(args) {
278274
// Markdown default: route through the normal renderer so an oversized
279275
// preflight payload is truncated *with* a retrieval handle. Passing the
@@ -575,7 +571,12 @@ fn bounded_lcm_expand_query_floor_text(
575571

576572
// Drop the unbounded arrays entirely; the synthesis prompt below tells the
577573
// bridge the context was elided and pagination/node ids are recoverable.
578-
for key in ["context_blocks", "matches", "node_ids", "context_pagination"] {
574+
for key in [
575+
"context_blocks",
576+
"matches",
577+
"node_ids",
578+
"context_pagination",
579+
] {
579580
object.insert(key.to_string(), json!([]));
580581
object.insert(format!("{key}_truncated_for_mcp"), json!(true));
581582
}
@@ -604,10 +605,7 @@ fn bounded_lcm_expand_query_floor_text(
604605
if let Some(record) = &handle {
605606
object.insert("response_handle".to_string(), json!(record.handle));
606607
object.insert("retrieve_tool".to_string(), json!(RESPONSE_RETRIEVE_TOOL));
607-
object.insert(
608-
"retrieve_expires_at".to_string(),
609-
json!(record.expires_at),
610-
);
608+
object.insert("retrieve_expires_at".to_string(), json!(record.expires_at));
611609
object.insert(
612610
"retrieve_instruction".to_string(),
613611
json!(format!(
@@ -631,7 +629,7 @@ fn bounded_lcm_expand_query_floor_text(
631629
"needs_synthesis": value
632630
.get("needs_synthesis")
633631
.cloned()
634-
.unwrap_or_else(|| json!(true)),
632+
.unwrap_or(json!(true)),
635633
"context_blocks": [],
636634
"matches": [],
637635
"mcp_response_truncated": true,
@@ -2439,7 +2437,8 @@ mod tests {
24392437

24402438
#[test]
24412439
fn message_text_snippet_extracts_readable_content_from_json() {
2442-
let text = "[{\"type\":\"tool_result\",\"content\":\"hello world\",\"tool_use_id\":\"toolu_1\"}]";
2440+
let text =
2441+
"[{\"type\":\"tool_result\",\"content\":\"hello world\",\"tool_use_id\":\"toolu_1\"}]";
24432442
let snippet = message_text_snippet(text, 240);
24442443
assert_eq!(snippet, "hello world");
24452444
assert!(!snippet.contains("tool_use_id"));
@@ -2456,10 +2455,7 @@ mod tests {
24562455
#[test]
24572456
fn message_text_snippet_plain_text_is_collapsed() {
24582457
let text = "line one\n\n line two\ttabbed";
2459-
assert_eq!(
2460-
message_text_snippet(text, 240),
2461-
"line one line two tabbed"
2462-
);
2458+
assert_eq!(message_text_snippet(text, 240), "line one line two tabbed");
24632459
}
24642460

24652461
#[test]

0 commit comments

Comments
 (0)