Comprehensive Rust(繁体中文) 202406Clippy 3 minutes 盧恩演算法 30 minutes 27.1 單元測試 Rust 和 Cargo 提供了一個簡單的單元測試 (unit test) 框架: • 在你的程式碼的任何地方都可添加單元測試。 • 整合測試 (integration test) 則可放置在 tests/ 資料夾下。 測試會以 #[test] 標示。單元測試通常會位於巢狀的 tests 模組中,使用 #[cfg(test)] Lint,請改用 Playground 網站。 解析 Lint 後,請在 Playground 網站上執行 clippy,顯示 clippy 警告。Clippy 提供大量 Lint 說明文 件,且會一直添加新的 Lint (包括預設拒絕的 Lint)。 請注意,您可以使用 cargo fix 或編輯器,修正含有 help: ... 的錯誤或警告。 27.4 盧恩演算法 盧恩演算法 盧恩演算法可0 码力 | 356 页 | 1.41 MB | 1 年前3
共 1 条
- 1













