我有一个 Rust 1.82.0 的 Rust 工作区箱。 Clippy 的配置位于
Cargo.toml
内部。 Clippy 的配置部分如下所示:
[workspace.lints.rust]
rust_2024_compatibility = { level = "deny", priority = -1 }
unsafe_code = { level = "forbid", priority = 0 }
[workspace.lints.clippy]
cargo = { level = "deny", priority = -1 }
complexity = { level = "deny", priority = -1 }
correctness = { level = "deny", priority = -1 }
pedantic = { level = "deny", priority = -1 }
perf = { level = "deny", priority = -1 }
restriction = { level = "warn", priority = -1 }
style = { level = "deny", priority = -1 }
如果我运行
cargo clippy --all-targets
,则不会报告任何警告。但是,当显式启用迂腐警告时,cargo clippy --all-targets -- -D clippy::pedantic
,会报告两个错误:clippy::missing_errors_doc
和clippy::semicolon_if_nothing_returned
。
如何解决?