rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/

Results 741 rust-clippy issues
Sort by recently updated
recently updated
newest added

It is valuable to organize code in different files without necessarily representing that hierarchy in the module tree, by re-exporting types up toward the root: ```rust mod foo; pub use...

### Summary When returning the result of a function `fn f(...) -> T` from a lambda `|| -> () { ... }`, removing the lambda’s return type annotation leads to...

C-bug
I-suggestion-causes-error
I-false-positive

Fixes rust-lang/rust-clippy#14971 WIP because: - [ ] is there a way to remove the block braces from the suggestion? - [ ] I guess the "Known problems" section is not...

S-waiting-on-review

This pr adds the `manual_as_slice` lint. closes: rust-lang/rust-clippy#7633 ---- changelog: add [`manual_as_slice`] lint

S-waiting-on-review

### What it does Projects typically use a single convention for safety docs and comments, typically `# Safety` sections in docs and `// SAFETY:` comments. However, it is possible for...

A-lint

### Summary `unnecessary_safety_comment` appears to detect `/// SAFETY: ...` as a safety comment (i.e. not `# Safety` section) in a normal function, but it doesn't inside an `impl` block. ###...

C-bug
I-false-negative

### Summary If I run any of these commands: - `cargo clippy --fix --workspace --all-targets --all-features` - `cargo clippy --fix --example "custom-backend"` - `cargo clippy --fix --lib -p jj-lib` on...

C-bug

fixes rust-lang/rust-clippy#2394 changelog: [`redundant_box`]: Lint on unnecessarily boxed types (sized types no bigger than a thin pointer).

### What it does For Rust code blocks, and for code blocks in many other languages, it is very likely that extra indentation is not indented if it is applied...

A-lint

### What it does Given a sequence of `Option` types like `&[Option]`, users sometimes tend to iterate with `filter + map(unwrap)` sequence. Instead, they should use `.flatten().map()` without the unwrap....

A-lint