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 560 rust-clippy issues
Sort by recently updated
recently updated
newest added

I am unable to disable (allow) the `clippy::similar_names` lint the way I expect. Usually I would place `#[allow(clippy::x)]` before the offending line, and the lint error would go away. In...

C-bug

### Description I don't know if I should report this issue here or at `/rust-lang/rust/`. I was reading the docs, and found `clippy::arithmetic_side_effects`, set it to level `warn`, and `rustc`...

### What it does This lints on any expression of the form `some_arithmetic_expr(function_pointer as NumericType, other_type)`. For example (note the lack of parenthesis - all of the function used here...

A-lint

### What it does These collection types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From.html#impl-From%3C%5BT%3B%20N%5D%3E-for-HashSet%3CT%2C%20RandomState%3E): `HashSet`, `BTreeSet`, `BinaryHeap`, `LinkedList`, `VecDeque` (and `Vec`). These collection types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From.html#impl-From%3C%5B(K%2C%20V)%3B%20N%5D%3E-for-HashMap%3CK%2C%20V%2C%20RandomState%3E): `HashMap`, `BTreeMap`. Suppose you want to construct one of...

A-lint

### Description I was getting this warning ``` warning: use of `or_insert` followed by a call to `new` --> components/dada-lang/src/test_harness.rs:445:18 | 445 | .or_insert(vec![]) | ^^^^^^^^^^^^^^^^^ help: try this: `or_default()`...

### Summary I have a proxy type (a symbol from a string interner) which has `len` and `is_empty` method which: - are fallible - take the interner as a method...

C-bug
good-first-issue
I-false-positive

Fixes #9477 Fixes #6751 Identifies common patterns where usage of the `clamp` function would be more succinct and clear, and suggests using the `clamp` function instead. changelog: [`manual_clamp`]: Implement manual_clamp...

S-waiting-on-review

### Summary Because the try operator cannot be used in closures, replacing a manual implementation of find with an actual function call results in changed semantics that are not simple...

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

Adds a lint to tell the user if the let_else pattern should be used. ~~The PR is blocked probably on rustfmt support, as clippy shouldn't suggest features that aren't yet...

S-blocked

```rust #[deny(clippy::std_instead_of_core)] fn _foo() -> impl std::error::Error { // Error! std::env::VarError::NotPresent } ``` The same behaviour does not happen with other `std` structures. ```rust #[deny(clippy::std_instead_of_core)] fn _foo() -> std::env::VarError {...

C-bug
I-false-positive