chore: remove stale dead_code allows in aimdb-cli, aimdb-mcp and the zenoh profile module

Open Beginner friendly
#462 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
tooling

Research direction

Read the three locations named in the issue: tools/aimdb-cli/src/error.rs, tools/aimdb-mcp/src/server.rs, and aimdb-zenoh-connector/src/profile/mod.rs. Remove the listed suppressions and run the Makefile build and clippy feature combinations to find any remaining warnings, especially with the ros2 feature off. Done when these checks pass without broad suppressions and any necessary allowance is scoped to the affected item.

Written by the indexing model from the issue text.

Description

🏷️ good first issue enhancement

Problem

Three #[allow(dead_code)] suppressions have outlived their reason. They no longer hide anything today, but they will silently hide real dead code in future.

  1. tools/aimdb-cli/src/error.rs:23 — #[allow(dead_code)] // Some variants are for future use on CliError, and :141 — #[allow(dead_code)] // Helper methods for future use on its constructor helpers. Every helper (connection_failed, record_not_found, write_protected, protocol_mismatch, invalid_json, server_error) has at least one caller in tools/aimdb-cli/src, and the variants are constructed either through those helpers or in the From<ClientError> conversion.
  2. tools/aimdb-mcp/src/server.rs:103 — #[allow(dead_code)] on set_state, which is called at line 119 and in the tests.
  3. aimdb-zenoh-connector/src/profile/mod.rs:8 — a module-wide #[allow(dead_code, unused_imports)] with the comment "Used by the ROS 2 connector, which builds on this module". ros2.rs now exists and uses most of the module (Attachment, Durability, EntityKind, History, Node, Qos, Reliability, validate_*, data_key, entity_token, node_token, gid).

Suggested work

  • Remove the three allows and build/clippy with the feature combinations the Makefile uses.
  • For anything that then warns (most likely in the zenoh profile module when the ros2 feature is off), either delete it or scope a narrow #[cfg_attr(not(feature = "…"), allow(dead_code))] to that item instead of the whole module.

Notes

Usage was checked by grep at d9c7be0, not by compiling without the allows, so a few items may still warn under some feature combinations.

Dominant language
Rust
Stars
101
Forks
20
Avg merge
2h 33m
Merged PRs (30d)
90

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aimdb-dev/aimdb

All issues in aimdb-dev/aimdb

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.