unsafe: flush() 中缺少 SAFETY 注释 (avhw.rs:757) #7
Reference in New Issue
Block a user
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?
位置
src/avhw.rs:757-762严重性
🟢 低
问题描述
flush()中的unsafe块(发送 null frame 刷新编码器)缺少 SAFETY 注释。Rust 项目最佳实践要求每个unsafe块都附有解释其安全性的注释。建议修复
修复完成
Issue 原指 flush() 中第 766 行缺少 SAFETY 注释,实际审核发现文件中共有 19 处 unsafe 缺少文档。
修复内容
1. 补全 SAFETY 注释(19 处)
2. 加固防御性检查(2 处)
3. 启用 Clippy lint 防止回归
验证
7c1c9b2