Project

General

Profile

Actions

Optimization #4591

open

Fix Rust clippy lints

Added by Juliana Fajardini Reichow about 1 year ago. Updated 11 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Effort:
Difficulty:
Label:
Rust

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

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


Subtasks 25 (21 open4 closed)

Optimization #4592: Fix warning about "for loop over fallibles"NewActions
Optimization #4593: Fix warning about "mixed case hex literals"NewActions
Optimization #4594: Fix warning about "this loop never actually loops"NewActions
Optimization #4595: Fix warning about "comparing with null"ClosedSam MuhammedActions
Optimization #4596: Fix warning about "single match"NewActions
Optimization #4597: Fix warning about "enum's name"NewActions
Optimization #4598: Fix warning about "needless_range_loop"NewActions
Optimization #4599: Fix warning about "ptr_arg"NewActions
Optimization #4600: Fix warning about "needless lifetimes"NewActions
Optimization #4601: Fix warning about "while let loop"NewActions
Optimization #4602: Fix warning about "new without default"NewActions
Optimization #4603: Fix warning about "type complexity"NewActions
Optimization #4604: Fix warning about "branches sharing code"NewActions
Optimization #4605: Fix warning about "unnecessary nested match"ClosedModupe FalodunActions
Optimization #4606: Fix warning about "match ref pats"NewActions
Optimization #4607: Fix warning about "match like matches macro"NewActions
Optimization #4608: Fix warning about "redundant pattern matching"NewActions
Optimization #4609: Fix warning about "if same then else"NewActions
Optimization #4610: Fix warning about "explicit counter loop"NewActions
Optimization #4611: Fix warning about "extra unused lifetimes"NewActions
Optimization #4612: Fix warning about "nonminimal bool"NewActions
Optimization #4613: Fix warning about "large enum variant"NewActions
Optimization #4614: Fix warning about "field reassign with default"NewActions
Optimization #4616: Fix warning about "match single binding"ClosedSam MuhammedActions
Optimization #4618: Fix warning about "inherent to string"ClosedModupe FalodunActions
Actions #1

Updated by Juliana Fajardini Reichow about 1 year ago

  • Description updated (diff)
Actions #2

Updated by Jason Ish about 1 year 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.

Actions

Also available in: Atom PDF