Skip to content

Commit f5a88b6

Browse files
committed
Allow hex literals to pass w/ groups of 2
1 parent db8380c commit f5a88b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/literal_representation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl LiteralDigitGrouping {
368368

369369
let first = groups.next().expect("At least one group");
370370

371-
if (radix == Radix::Binary || radix == Radix::Hexadecimal) && groups.any(|i| i % 4 != 0) {
371+
if (radix == Radix::Binary || radix == Radix::Hexadecimal) && groups.any(|i| i != 4 || i != 2) {
372372
return Err(WarningType::UnusualByteGrouping);
373373
}
374374

0 commit comments

Comments
 (0)