From f92c91601e1f28dd29be7157010673a2b5b6b87d Mon Sep 17 00:00:00 2001 From: Alexandru Ene Date: Fri, 3 Nov 2017 20:54:33 +0000 Subject: [PATCH] Addressed PR comments --- clippy_lints/src/non_expressive_names.rs | 4 ++-- tests/ui/non_expressive_names.rs | 2 +- tests/ui/non_expressive_names.stderr | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clippy_lints/src/non_expressive_names.rs b/clippy_lints/src/non_expressive_names.rs index e4d7049bf..408e6304a 100644 --- a/clippy_lints/src/non_expressive_names.rs +++ b/clippy_lints/src/non_expressive_names.rs @@ -156,9 +156,9 @@ impl<'a, 'tcx, 'b> SimilarNamesNameVisitor<'a, 'tcx, 'b> { if interned_name.chars().all(|c| c.is_digit(10) || c == '_') { span_lint( self.0.cx, - JUST_UNDERSCORES_AND_NUMBERS, + JUST_UNDERSCORES_AND_DIGITS, span, - "binding whose name is just underscores and digits", + "consider choosing a more descriptive name", ); return; } diff --git a/tests/ui/non_expressive_names.rs b/tests/ui/non_expressive_names.rs index 16a035ca0..29a677004 100644 --- a/tests/ui/non_expressive_names.rs +++ b/tests/ui/non_expressive_names.rs @@ -140,4 +140,4 @@ fn underscores_and_numbers() { let ____1 = 1; //~ERROR Consider a more descriptive name let __1___2 = 12; //~ERROR Consider a more descriptive name let _1_ok= 1; -} \ No newline at end of file +} diff --git a/tests/ui/non_expressive_names.stderr b/tests/ui/non_expressive_names.stderr index 7141c97dd..6412b47aa 100644 --- a/tests/ui/non_expressive_names.stderr +++ b/tests/ui/non_expressive_names.stderr @@ -129,21 +129,21 @@ error: 5th binding whose name is just one char 129 | e => panic!(), | ^ -error: binding whose name is just underscores and digits +error: consider choosing a more descriptive name --> $DIR/non_expressive_names.rs:139:9 | 139 | let _1 = 1; //~ERROR Consider a more descriptive name | ^^ | - = note: `-D just-underscores-and-numbers` implied by `-D warnings` + = note: `-D just-underscores-and-digits` implied by `-D warnings` -error: binding whose name is just underscores and digits +error: consider choosing a more descriptive name --> $DIR/non_expressive_names.rs:140:9 | 140 | let ____1 = 1; //~ERROR Consider a more descriptive name | ^^^^^ -error: binding whose name is just underscores and digits +error: consider choosing a more descriptive name --> $DIR/non_expressive_names.rs:141:9 | 141 | let __1___2 = 12; //~ERROR Consider a more descriptive name