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

### Summary We have this function in our crate https://github.com/AFLplusplus/LibAFL/tree/main/libafl https://github.com/AFLplusplus/LibAFL/blob/main/libafl/src/observers/mod.rs#L816 ``` #[pyo3(name = "match_name")] #[allow(clippy::all)] fn pymatch_name(&self, name: &str) -> Option { for ob in &self.list { if *ob.name()...

C-bug
I-false-positive

Lint name: `future_not_send` I tried this code: ```rust async fn recv_msg { let len = reader.read_u16().await? as usize; buf.resize_with(len, u8::default); let bytes_read = reader.read_exact(buf).await?; debug_assert_eq!(bytes_read, len); Ok(buf) } ``` I...

C-bug
I-false-positive
L-nursery

This is a minimal and hacky implementation right now, but it should get the idea across. A large number of suggestions in clippy are basically extracting a snippet of an...

S-waiting-on-review

### What it does I would like clippy to lint against *all* integer casts. So I have set: ```rust #![warn( clippy::cast_possible_wrap, // unsigned -> signed clippy::cast_sign_loss, // signed -> unsigned...

good-first-issue
A-lint

### What it does Similar to `extra_unused_lifetimes`, checks for unused type parameters on functions and warns that this is likely unintended, suggesting that they be removed. (Note: should this only...

A-lint

### Summary When having complex trait bounds `trait_duplication_in_bounds` warns incorrectly ### Lint Name trait_duplication_in_bounds ### Reproducer I tried [this code](https://github.com/tremor-rs/tremor-runtime/blob/main/tremor-influx/src/decoder.rs#L31-L73): ```rust fn parse_fields Result where V: Value + Mutable +...

C-bug
I-false-positive

### Summary If I add ```rust use anyhow::Result; ``` and use `Result` only in my tests, clippy thinks this import is unused. ### Lint Name unused_imports ### Reproducer This is...

C-bug
I-false-positive

### Summary blacklisted_name should toralate use of such name as `foo`. As far as I see the source code, it tries to allow `foo` in tests, but it doesn't. Similar...

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

### What it does This lint suggests using the feature added in the 1.58 version of Rust: implicit named arguments for formatting macros. ### Lint Name implicit_named_arguments ### Category style...

A-lint

### Summary ```rust fn v1(a: bool, b: bool) { if a { if b { todo!() } } } fn v2(a: bool, b: bool) { if a { // comment...

C-bug