about summary refs log tree commit diff
diff options
context:
space:
mode:
authorcgm616 <cgm616@me.com>2020-10-25 11:31:24 -0400
committercgm616 <cgm616@me.com>2020-10-25 11:31:24 -0400
commit312bbff6968dbebd367ca90677c676e2cf5198d2 (patch)
tree472edb78a942b9280bc761ab9db48482939b3d08
parente7e4b35bdf695c4db5a1f34319d01b12a9d54b34 (diff)
downloadrust-312bbff6968dbebd367ca90677c676e2cf5198d2.tar.gz
rust-312bbff6968dbebd367ca90677c676e2cf5198d2.zip
Integrate suggestions from code review
-rw-r--r--CHANGELOG.md2
-rw-r--r--clippy_lints/src/lib.rs6
-rw-r--r--clippy_lints/src/literal_representation.rs14
-rw-r--r--src/lintlist/mod.rs2
-rw-r--r--tests/ui/large_digit_groups.stderr2
-rw-r--r--tests/ui/literals.rs8
-rw-r--r--tests/ui/literals.stderr2
-rw-r--r--tests/ui/unreadable_literal.stderr2
8 files changed, 19 insertions, 19 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c0dd7b352ad..25f3b5da198 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2017,7 +2017,7 @@ Released 2018-09-13
 [`unused_label`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_label
 [`unused_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
 [`unused_unit`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
-[`unusual_byte_grouping`]: https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_grouping
+[`unusual_byte_groupings`]: https://rust-lang.github.io/rust-clippy/master/index.html#unusual_byte_groupings
 [`unwrap_in_result`]: https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_in_result
 [`unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
 [`use_debug`]: https://rust-lang.github.io/rust-clippy/master/index.html#use_debug
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 5d6900f6b96..3be8bc0e36d 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -623,7 +623,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         &literal_representation::LARGE_DIGIT_GROUPS,
         &literal_representation::MISTYPED_LITERAL_SUFFIXES,
         &literal_representation::UNREADABLE_LITERAL,
-        &literal_representation::UNUSUAL_BYTE_GROUPING,
+        &literal_representation::UNUSUAL_BYTE_GROUPINGS,
         &loops::EMPTY_LOOP,
         &loops::EXPLICIT_COUNTER_LOOP,
         &loops::EXPLICIT_INTO_ITER_LOOP,
@@ -1366,7 +1366,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         LintId::of(&lifetimes::NEEDLESS_LIFETIMES),
         LintId::of(&literal_representation::INCONSISTENT_DIGIT_GROUPING),
         LintId::of(&literal_representation::MISTYPED_LITERAL_SUFFIXES),
-        LintId::of(&literal_representation::UNUSUAL_BYTE_GROUPING),
+        LintId::of(&literal_representation::UNUSUAL_BYTE_GROUPINGS),
         LintId::of(&loops::EMPTY_LOOP),
         LintId::of(&loops::EXPLICIT_COUNTER_LOOP),
         LintId::of(&loops::FOR_KV_MAP),
@@ -1589,7 +1589,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         LintId::of(&len_zero::LEN_WITHOUT_IS_EMPTY),
         LintId::of(&len_zero::LEN_ZERO),
         LintId::of(&literal_representation::INCONSISTENT_DIGIT_GROUPING),
-        LintId::of(&literal_representation::UNUSUAL_BYTE_GROUPING),
+        LintId::of(&literal_representation::UNUSUAL_BYTE_GROUPINGS),
         LintId::of(&loops::EMPTY_LOOP),
         LintId::of(&loops::FOR_KV_MAP),
         LintId::of(&loops::NEEDLESS_RANGE_LOOP),
diff --git a/clippy_lints/src/literal_representation.rs b/clippy_lints/src/literal_representation.rs
index f51a0edc9c5..e8a741683da 100644
--- a/clippy_lints/src/literal_representation.rs
+++ b/clippy_lints/src/literal_representation.rs
@@ -96,7 +96,7 @@ declare_clippy_lint! {
     /// let x: u32 = 0xFFF_FFF;
     /// let y: u8 = 0b01_011_101;
     /// ```
-    pub UNUSUAL_BYTE_GROUPING,
+    pub UNUSUAL_BYTE_GROUPINGS,
     style,
     "binary or hex literals that aren't grouped by four"
 }
@@ -144,7 +144,7 @@ enum WarningType {
     LargeDigitGroups,
     DecimalRepresentation,
     MistypedLiteralSuffix,
-    UnusualByteGrouping,
+    UnusualByteGroupings,
 }
 
 impl WarningType {
@@ -195,9 +195,9 @@ impl WarningType {
                 suggested_format,
                 Applicability::MachineApplicable,
             ),
-            Self::UnusualByteGrouping => span_lint_and_sugg(
+            Self::UnusualByteGroupings => span_lint_and_sugg(
                 cx,
-                UNUSUAL_BYTE_GROUPING,
+                UNUSUAL_BYTE_GROUPINGS,
                 span,
                 "digits of hex or binary literal not grouped by four",
                 "consider",
@@ -213,7 +213,7 @@ declare_lint_pass!(LiteralDigitGrouping => [
     INCONSISTENT_DIGIT_GROUPING,
     LARGE_DIGIT_GROUPS,
     MISTYPED_LITERAL_SUFFIXES,
-    UNUSUAL_BYTE_GROUPING,
+    UNUSUAL_BYTE_GROUPINGS,
 ]);
 
 impl EarlyLintPass for LiteralDigitGrouping {
@@ -268,7 +268,7 @@ impl LiteralDigitGrouping {
                     let should_warn = match warning_type {
                         | WarningType::UnreadableLiteral
                         | WarningType::InconsistentDigitGrouping
-                        | WarningType::UnusualByteGrouping
+                        | WarningType::UnusualByteGroupings
                         | WarningType::LargeDigitGroups => {
                             !in_macro(lit.span)
                         }
@@ -369,7 +369,7 @@ impl LiteralDigitGrouping {
         let first = groups.next().expect("At least one group");
 
         if (radix == Radix::Binary || radix == Radix::Hexadecimal) && groups.any(|i| i != 4 && i != 2) {
-            return Err(WarningType::UnusualByteGrouping);
+            return Err(WarningType::UnusualByteGroupings);
         }
 
         if let Some(second) = groups.next() {
diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs
index fc8efb81cfc..6272ce45efb 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -2644,7 +2644,7 @@ vec![
         module: "unused_unit",
     },
     Lint {
-        name: "unusual_byte_grouping",
+        name: "unusual_byte_groupings",
         group: "style",
         desc: "binary or hex literals that aren\'t grouped by four",
         deprecation: None,
diff --git a/tests/ui/large_digit_groups.stderr b/tests/ui/large_digit_groups.stderr
index fe472e66949..13d108b56e0 100644
--- a/tests/ui/large_digit_groups.stderr
+++ b/tests/ui/large_digit_groups.stderr
@@ -4,7 +4,7 @@ error: digits of hex or binary literal not grouped by four
 LL |         0x1_234_567,
    |         ^^^^^^^^^^^ help: consider: `0x0123_4567`
    |
-   = note: `-D clippy::unusual-byte-grouping` implied by `-D warnings`
+   = note: `-D clippy::unusual-byte-groupings` implied by `-D warnings`
 
 error: digits of hex or binary literal not grouped by four
   --> $DIR/large_digit_groups.rs:22:9
diff --git a/tests/ui/literals.rs b/tests/ui/literals.rs
index 2608638ff80..a72a74b9131 100644
--- a/tests/ui/literals.rs
+++ b/tests/ui/literals.rs
@@ -7,10 +7,10 @@
 
 fn main() {
     let ok1 = 0xABCD;
-    let ok3 = 0xabcd;
-    let ok4 = 0xabcd_i32;
-    let ok5 = 0xABCD_u32;
-    let ok5 = 0xABCD_isize;
+    let ok3 = 0xab_cd;
+    let ok4 = 0xab_cd_i32;
+    let ok5 = 0xAB_CD_u32;
+    let ok5 = 0xAB_CD_isize;
     let fail1 = 0xabCD;
     let fail2 = 0xabCD_u32;
     let fail2 = 0xabCD_isize;
diff --git a/tests/ui/literals.stderr b/tests/ui/literals.stderr
index e321f2a1cef..64ceeb316d8 100644
--- a/tests/ui/literals.stderr
+++ b/tests/ui/literals.stderr
@@ -75,7 +75,7 @@ error: digits of hex or binary literal not grouped by four
 LL |     let fail24 = 0xAB_ABC_AB;
    |                  ^^^^^^^^^^^ help: consider: `0x0ABA_BCAB`
    |
-   = note: `-D clippy::unusual-byte-grouping` implied by `-D warnings`
+   = note: `-D clippy::unusual-byte-groupings` implied by `-D warnings`
 
 error: digits of hex or binary literal not grouped by four
   --> $DIR/literals.rs:38:18
diff --git a/tests/ui/unreadable_literal.stderr b/tests/ui/unreadable_literal.stderr
index fa4c3fe13e3..8645cabeabb 100644
--- a/tests/ui/unreadable_literal.stderr
+++ b/tests/ui/unreadable_literal.stderr
@@ -4,7 +4,7 @@ error: digits of hex or binary literal not grouped by four
 LL |         0x1_234_567,
    |         ^^^^^^^^^^^ help: consider: `0x0123_4567`
    |
-   = note: `-D clippy::unusual-byte-grouping` implied by `-D warnings`
+   = note: `-D clippy::unusual-byte-groupings` implied by `-D warnings`
 
 error: long literal lacking separators
   --> $DIR/unreadable_literal.rs:25:17