Skip to content

Commit

Permalink
Allow hex literals to pass w/ groups of 2
Browse files Browse the repository at this point in the history
  • Loading branch information
cgm616 committed Oct 25, 2020
1 parent db8380c commit f5a88b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/literal_representation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ impl LiteralDigitGrouping {

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

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

Expand Down

0 comments on commit f5a88b6

Please sign in to comment.