X0015 clippy-perf¶
Rule: No finding of clippy's perf group: no needlessly slow code.
| Code | X0015 (stable, never reused) |
| Id | clippy-perf |
| Category | clippy |
| Source | clippy (run as an executable) |
| Fix | by hand |
| Needs | clippy installed |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | off | |
| small-workspace | off | |
| medium | off | |
| big | off | |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
Clippy's perf group finds code that can be written to run faster. It is on by default, so these findings appear without any setup; the project's [lints.clippy] table can change the level of single lints.
How to fix¶
Follow the help of the finding; the finding names the clippy lint, and cargo clippy --explain NAME explains it. A place where the lint is wrong gets #[expect(clippy::NAME, reason = "...")], or a spirit_level waiver of clippy-perf.
Configure¶
Allow one finding in the code with // spirit-level: allow(clippy-perf) <reason> (waivers); the code works there too, as in [lints.X0015].