Skip to content

Commit b859663

Browse files
Test Userclaude
andcommitted
fix(rlm): clear 3 clippy -D warnings errors in mcp_tools.rs
Resolves #3008: `cargo clippy --workspace -- -D warnings` exited 101 on committed code (introduced by 4a8ce5c, the mcp_search_skills feature). This blocked every PR touching terraphim_rlm and the CI clippy gate proposed in #2930/#2934. Three surgical fixes (1 file, +3/-6): 1. mcp_tools.rs:428-431 — clippy::doc_lazy_continuation (x2) Root cause: line 429 began with `+ author`, where `+` + space is a markdown list-item marker, making lines 430-431 unindented lazy continuations. Repositioned the line break so `+` lands at end of line 428. Wording preserved verbatim. 2. mcp_tools.rs:1021 — clippy::redundant_closure `.map(|v| serde_json::from_value::<SkillEntry>(v))` -> `.map(serde_json::from_value::<SkillEntry>)`. Empirically verified the function-pointer form compiles cleanly (exit 0), disproving the now-removed cautionary comment at L1015-1017 that cited "stable-Rust inference quirks". The comment was stale. Verification (this session): - RED baseline: 3 errors reproduce identically on pristine origin/main - cargo clippy -p terraphim_rlm -- -D warnings -> exit 0 - cargo clippy --workspace -- -D warnings -> exit 0 (issue core gate) - cargo test -p terraphim_rlm --lib -> 135 passed, 0 failed (exact match to issue baseline; zero behavioural change) - UBS on mcp_tools.rs: 2 critical, 73 warning BOTH before and after my edit (stash-verified) -> my change adds zero new findings. The 2 pre-existing criticals are `panic!` in test match-arms at L1183, unrelated to this lint fix. Scope note on AC6 (`cargo fmt --all -- --check`): The issue's fmt AC is over-scoped. 6 pre-existing fmt hunks live in mcp_tools.rs at lines 29, 932, 996, 1164, 1200 — none touched by this fix (proven: stash->fmt->pop yields identical 6 hunks on pristine HEAD). Absorbing them would violate one-concern-per-PR and contaminate this lint fix with unrelated drift. PR #3011 independently documents this same pre-existing drift. This PR is scoped to the 3 clippy errors only. Refs #3008 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 55e959a commit b859663

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

crates/terraphim_rlm/src/mcp_tools.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ impl RlmMcpService {
425425
/// the caller decides which corpus to feed; this service does not
426426
/// maintain its own skill registry.
427427
///
428-
/// `SkillEntry` is a discovery projection (name + description + version
429-
/// + author + tags) — `inputs` and `steps` are intentionally NOT part
428+
/// `SkillEntry` is a discovery projection (name + description + version +
429+
/// author + tags) — `inputs` and `steps` are intentionally NOT part
430430
/// of the search index because they're workflow-shape, not
431431
/// discoverability-shape.
432432
fn mcp_search_skills_tool() -> Tool {
@@ -1012,13 +1012,10 @@ impl RlmMcpService {
10121012
ErrorData::invalid_params("'skills' must be an array of skill entries", None)
10131013
})?;
10141014

1015-
// Explicit closure (not function pointer) to avoid stable-Rust
1016-
// inference quirks with `serde_json::from_value` (consumes its
1017-
// argument).
10181015
let skills: Vec<SkillEntry> = skills_array
10191016
.iter()
10201017
.cloned()
1021-
.map(|v| serde_json::from_value::<SkillEntry>(v))
1018+
.map(serde_json::from_value::<SkillEntry>)
10221019
.collect::<Result<Vec<_>, _>>()
10231020
.map_err(|e| ErrorData::invalid_params(format!("Invalid skill entry: {}", e), None))?;
10241021

0 commit comments

Comments
 (0)