From 7db1ea907de55338d4069924dd1575d4e9b6cf60 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 7 Dec 2021 18:40:17 -0800 Subject: [PATCH] Ignore needless_late_init Clippy lint 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 | }; | + --- src/lib.rs | 1 + tests/lexical.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 7332f0ae5..50a6f8237 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 diff --git a/tests/lexical.rs b/tests/lexical.rs index be730420f..928ad6572 100644 --- a/tests/lexical.rs +++ b/tests/lexical.rs @@ -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,