Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Commit 983b5b3

Browse files
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

File tree

‎src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
clippy::redundant_else,
8585
clippy::single_match_else,
8686
// code is acceptable
87+
clippy::blocks_in_if_conditions,
8788
clippy::cast_possible_wrap,
8889
clippy::cast_precision_loss,
8990
clippy::doc_markdown,

0 commit comments

Comments
 (0)