Skip to content

refactor(storage): reduce crate:: refs 19→5 via use consolidation#11

Merged
juice094 merged 2 commits into
mainfrom
fix/storage-coupling-cleanup
May 11, 2026
Merged

refactor(storage): reduce crate:: refs 19→5 via use consolidation#11
juice094 merged 2 commits into
mainfrom
fix/storage-coupling-cleanup

Conversation

@juice094
Copy link
Copy Markdown
Owner

storage.rs 耦合治理:

  • 集中导入外部模块(config, i18n, registry, search)
  • 消除 14 个行内 crate:: 全路径引用
  • 自引用 DefaultStorageBackend/TempStorageBackend 简化为直接使用
  • crate:: 引用: 19 → 5 (-74%)

验证: cargo check 0 errors; clippy 0 warnings; test 503 passed / 0 failed

juice094 added 2 commits May 11, 2026 13:29
**问题**: storage.rs 有 19 个行内 crate:: 引用,耦合度偏高。

**方案**:
集中导入外部模块,消除行内全路径引用:
-  →
-
-
-
- 测试局部导入
- 自引用  /  → 直接使用

**效果**:
- storage.rs crate:: 引用: 19 → 5 (-74%)
- 零运行时行为变更

验证:
- cargo check --workspace: 0 errors
- cargo clippy --workspace --all-targets: 0 warnings
- cargo test --workspace: 503 passed / 0 failed / 4 ignored
- 4 个候选方案对比:A(补偿扫描)/B(FTS5)/C(2PC)/D(物化视图)
- 推荐:维持方案 A,v0.17.0 触发 FTS5 评估矩阵
- 附录:FTS5 功能评估矩阵(7 项维度)
- 工作量:FTS5 PoC 评估约 2-3 天
@juice094 juice094 merged commit 6b47bc5 into main May 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant