Skip to content

Commit

Permalink
Ignore needless_late_init Clippy lint
Browse files Browse the repository at this point in the history
    error: unneeded late initalization
       --> tests/../src/lexical/float.rs:173:9
        |
    173 |         let exp: u64;
        |         ^^^^^^^^^^^^^
        |
        = note: `-D clippy::needless-late-init` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
    help: declare `exp` here
        |
    174 |         let exp: u64 = if (fp.exp == F::DENORMAL_EXPONENT) && (fp.mant & F::HIDDEN_BIT_MASK.as_u64()) == 0 {
        |         ++++++++++++++
    help: remove the assignments from the branches
        |
    175 ~             0
    176 |         } else {
    177 ~             (fp.exp + F::EXPONENT_BIAS) as u64
        |
    help: add a semicolon after the `if` expression
        |
    178 |         };
        |          +
  • Loading branch information
dtolnay committed Dec 8, 2021
1 parent fc0ca07 commit 7db1ea9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@
clippy::match_like_matches_macro,
clippy::match_single_binding,
clippy::needless_doctest_main,
clippy::needless_late_init,
clippy::transmute_ptr_to_ptr,
clippy::unnecessary_wraps,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704
Expand Down
1 change: 1 addition & 0 deletions tests/lexical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
clippy::float_cmp,
clippy::if_not_else,
clippy::module_name_repetitions,
clippy::needless_late_init,
clippy::shadow_unrelated,
clippy::similar_names,
clippy::single_match_else,
Expand Down

0 comments on commit 7db1ea9

Please sign in to comment.