This repository was archived by the owner on Mar 25, 2024. It is now read-only.
Repository navigation
Commit 983b5b3
committed
Suppress blocks_in_if_conditions clippy lint
This code is fine. Clippy's suggestion is not better.
error: in an `if` condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
--> src/de.rs:990:5
|
990 | / if {
991 | | let v = v.trim_start_matches(&['-', '+'][..]);
992 | | v.len() > 1 && v.starts_with('0') && v.bytes().all(|b| b.is_ascii_digit())
993 | | } {
| |_____^
|
= note: `-D clippy::blocks-in-if-conditions` implied by `-D clippy::all`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_if_conditions
help: try
|
990 ~ let res = {
991 + let v = v.trim_start_matches(&['-', '+'][..]);
992 + v.len() > 1 && v.starts_with('0') && v.bytes().all(|b| b.is_ascii_digit())
993 ~ }; if res {
|1 parent 75a43c4 commit 983b5b3
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
0 commit comments