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

未关闭 适合新手
#462 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
tooling

调研方向

阅读 issue 中提到的三个位置:tools/aimdb-cli/src/error.rs、tools/aimdb-mcp/src/server.rs 和 aimdb-zenoh-connector/src/profile/mod.rs。移除列出的抑制,并运行 Makefile 中 build 和 clippy 的 feature 组合,以查找任何剩余警告,尤其是在关闭 ros2 feature 时。完成标准是这些检查在没有宽泛抑制的情况下通过,且任何必要的 allowance 都限定在受影响的项上。

由索引模型根据 Issue 内容生成。

描述

🏷️ 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.

主要语言
Rust
星标
101
派生
20
平均合并
2 小时 33 分钟
30 天内合并 PR
90

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aimdb-dev/aimdb 的其他 Issue

查看 aimdb-dev/aimdb 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。