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

Fixes #9193 We can always peel references because we are looking for a method-call, for which autoderef applies. ``` changelog: [`if_let_mutex`]: detect calls to `Mutex::lock()` if mutex is behind a...

S-waiting-on-review

### What it does I've found this "ingenious" snippet in a big Rust codebase, and Clippy didn't catch it. ### Lint Name str-split-count-1 ### Example ```rust if url.split('|').count() == 1...

A-lint

*Please write a short comment explaining your change (or "none" for internal only changes)* changelog: Add new lint [`positional_named_format_parameters`] to warn when named parameters in format strings are used as...

S-waiting-on-review

changelog: ``[`suspicious_to_owned`]`` ----------------- Hi, posting this unsolicited PR as I've been burned by this issue :) Being unsolicited, feel free to reject it or reassign a different lint level etc....

S-waiting-on-review

### Summary I'm programmatically commiting a patch to a git repo and then writing the hash (a [`git2::Oid`](https://docs.rs/git2/latest/git2/struct.Oid.html)) in a file: ``` let commit = util::commit(...); fs::write(path, commit); ``` if...

C-bug
E-medium
I-false-positive

Lint name: never_loop I tried this code: ```rust let response = 'outer: loop { for child in self.widgets.iter_mut() { if id

C-bug
I-false-positive

fixes #8548 A good chunk of the code is fixing false negatives. The old code banned any non late-bound regions from appearing in the callee's signature. The new version checks...

S-waiting-on-review

### What it does For any trait bounds that's not used on the function body, create an "unused" warning ### Lint Name unused_trait_bound ### Category pedantic ### Advantage - More...

A-lint

### Description While trying to create a new lint, I wrote [this line](https://github.com/rust-lang/rust-clippy/blob/812db454b862b3604d6dca812cdc3c7bc740f635/clippy_lints/src/methods/collapsible_str_replace.rs#L197): ```rust let to_arg_repr_set = FxHashSet::from_iter(to_arg_reprs.iter().cloned()); ``` The feedback I received was: ```sh error: usage of `FromIterator::from_iter` -->...

C-bug
I-suggestion-causes-error

changelog: [`suspicious_arguments`]: add lint for probably accidentally swapped arguments ---

S-waiting-on-review