Optimization #4591
closedFix Rust clippy lints
Description
Umbrella ticket for issues related to fixing Rust Clippy lints.
The goal is to clean Rust code from lint-related warnings. Each ticket covers a specific warning. The complete list is:
- https://rust-lang.github.io/rust-clippy/master/index.html#single_match
- https://rust-lang.github.io/rust-clippy/master/index.html#cmp_null
- https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
- https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
- https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
- https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
- https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats
- https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
- https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
- https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
- https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
- https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
- https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding
- https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
- https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
- https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals
- https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
- https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
- https://rust-lang.github.io/rust-clippy/master/index.html#never_loop
- https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
- https://rust-lang.github.io/rust-clippy/master/index.html#for_loops_over_fallibles
- https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop
- https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
- https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
- https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string
- https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
- https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
Clippy is "a collection of lints to catch common mistakes and improve Rust code".
Running
cargo clippy --all-features
Will show all existing warnings, which must be fixed manually.
For more information and an installation guide: https://github.com/rust-lang/rust-clippy#as-a-cargo-subcommand-cargo-clippy
Updated by Juliana Fajardini Reichow over 3 years ago
- Description updated (diff)
Updated by Jason Ish over 3 years ago
All these warnings are now suppressed in our build to reduce the noise of "cargo clippy" in a code review, and to aid in fixing these lints.
To enable a specific lint, open "rust/src/lib.rs" and look for the line:
// To be fixed, but remove the noise for now
Select the clippy lint to be fixed from the "allow" statements below and remove the line. "clippy lint" should show you the warnings for that specific lint now.
Updated by Juliana Fajardini Reichow about 2 years ago
- Assignee set to Jason Ish
Approved PR: https://github.com/OISF/suricata/pull/8219
Updated by Juliana Fajardini Reichow about 2 years ago
- Status changed from New to Closed
Updated by Jason Ish about 2 years ago
- Target version changed from TBD to 7.0.0-rc1