rust-clippy
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/
### Summary `literal_string_with_formatting_args` does not support `lazy_format::lazy_format!`. ### Lint Name literal_string_with_formatting_args ### Reproducer ``` warning: this looks like a formatting argument but it is not part of a formatting macro...
Fixes: rust-lang/rust-clippy#14980 changelog: Fix suggestion-cases-error of [`empty_line_after_outer_attr`]
### Summary ``` warning: function call inside of `expect` --> src\ops\mod.rs:1353:39 | 1353 | fs::remove_dir_all(req_p).expect(if symlink { | _______________________________________^ 1354 | | "Failed to remove requested symlink" 1355 | |...
### Summary I have 2 values to pass to a function. The first is borrowed (indirectly) from a field in the second, and the function needs a mutable reference of...
### Summary If a function argument is unused there is no way to know whether or not its signature is appropriate. It's better to not bother people with lints based...
### Summary `cloned_ref_to_slice_refs` lint may trigger when the `clone()` prevents borrow checker issues. ### Lint Name cloned_ref_to_slice_refs ### Reproducer I tried this code: ```rust use std::sync::RwLock; #[derive(Clone)] struct Foo; struct...
### Summary Minimal reproduction: ```rust pub fn one_borrow(data: &mut [u8]) { multiple_borrows( // warning: unnecessary use of `to_vec` // but if we remove `to_vec()`, we get // error[E0502]: cannot borrow...
### Summary When running `cargo clippy` it prints all warnings for all crates in the workspace. However when running it with `-Dwarnings`, it errors after the first crate that contains...
e.g. `x == 10 && x == 0`, or checks that can be simplified, e.g. `x > 10 && x > 12` (which can be simplified to `x > 12`)....
Fixes rust-lang/rust-clippy#14977 `unnecessary_debug_formatting` suggested display() regardless of MSRV. This adds MSRV check for OsStr and Path. changelog: [`unnecessary_debug_formatting`] respects MSRV