Cargo warnings and tests: dead code in mcp.rs + 3 clippy lints (fails make lint -D warnings) #45
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_router#45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Scanned the workspace on branch
developmentwithcargo check,cargo build,cargo clippy --all-targets, andcargo test --workspace. Tests pass (16/16), but the build emits 10 warnings, andmake lint/make test-allcurrently fail because they run clippy with-D warnings.All warnings live in
crates/hero_router/.Findings
1. Dead code — 7 unused functions in
crates/hero_router/src/server/mcp.rsThese surface on every
cargo check/build/test:named_to_positionalcoerce_valuecoerce_to_arraycoerce_to_boolcoerce_to_integercoerce_to_numbercoerce_to_stringThese look like they were written to translate MCP named arguments into positional JSON-RPC params with schema-driven type coercion, but nothing calls them. Either wire them into the MCP dispatch path or delete them.
2. Clippy-only warnings (3)
Only surface under
cargo clippy --all-targets:crates/hero_router/src/python_codegen.rs:539—collapsible_if: theif let Some(components) = ... { if !components.is_empty() { ... } }block can be collapsed with alet … elseor&&guard.crates/hero_router/src/server/terminal.rs:64—unnecessary_cast(i64→i64):existing.id.unwrap_or(0) as i64should drop theas i64.crates/hero_router/src/server/terminal.rs:181—unnecessary_cast(i64→i64):job.id.ok_or_else(...)? as i64should drop theas i64.Impact
make lint(cargo clippy --workspace --all-targets -- -D warnings) currently fails.make test-allfails at the lint step, so the CI recipe is currently red againstdevelopment.cargo build/cargo testsucceed but produce noisy output.Proposed fix
named_to_positional/coerce_*helpers inmcp.rs, unless there's a pending MCP change that needs them — in which case wire them in.ifinpython_codegen.rs:539.as i64casts inserver/terminal.rs.make test-allshould pass end-to-end.Reproduction
Environment: branch
development, rustc pinned viarust-toolchain/ workspace config.Cargo warnings: dead code in mcp.rs + 3 clippy lints (failsto Cargo warnings and tests: dead code in mcp.rs + 3 clippy lints (failsmake lint-D warnings)make lint-D warnings)