Skip to content

Commit 19183a6

Browse files
authored
Rollup merge of #5468 - Toxyxer:zero-single-char-names, r=flip1995
Zero single char names Fixes: #4086 changelog: - Make the inequality strict
2 parents 071a590 + ce372c1 commit 19183a6

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

clippy_lints/src/non_expressive_names.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<'a, 'tcx> SimilarNamesLocalVisitor<'a, 'tcx> {
9393
fn check_single_char_names(&self) {
9494
let num_single_char_names = self.single_char_names.iter().flatten().count();
9595
let threshold = self.lint.single_char_binding_names_threshold;
96-
if num_single_char_names as u64 >= threshold {
96+
if num_single_char_names as u64 > threshold {
9797
let span = self
9898
.single_char_names
9999
.iter()

clippy_lints/src/utils/conf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ define_Conf! {
135135
/// Lint: TYPE_COMPLEXITY. The maximum complexity a type can have
136136
(type_complexity_threshold, "type_complexity_threshold": u64, 250),
137137
/// Lint: MANY_SINGLE_CHAR_NAMES. The maximum number of single char bindings a scope may have
138-
(single_char_binding_names_threshold, "single_char_binding_names_threshold": u64, 5),
138+
(single_char_binding_names_threshold, "single_char_binding_names_threshold": u64, 4),
139139
/// Lint: BOXED_LOCAL. The maximum size of objects (in bytes) that will be linted. Larger objects are ok on the heap
140140
(too_large_for_stack, "too_large_for_stack": u64, 200),
141141
/// Lint: ENUM_VARIANT_NAMES. The minimum number of enum variants for the lints about variant names to trigger
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
single-char-binding-names-threshold = 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#![warn(clippy::many_single_char_names)]
2+
3+
fn main() {}

0 commit comments

Comments
 (0)