Skip to content

Commit ac2399a

Browse files
committed
Fix min_ident_chars: don't lint on non-single-char-params in trait method declaration
1 parent a69d1b8 commit ac2399a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_lints/src/min_ident_chars.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ impl LateLintPass<'_> for MinIdentChars {
8787
if matches!(&item.kind, rustc_hir::TraitItemKind::Fn(_, _)) {
8888
let param_names = cx.tcx.fn_arg_idents(item.owner_id.to_def_id());
8989
for ident in param_names.iter().flatten() {
90-
emit_min_ident_chars(self, cx, ident.as_str(), ident.span);
90+
let str = ident.as_str();
91+
if self.is_ident_too_short(cx, str, ident.span) {
92+
emit_min_ident_chars(self, cx, str, ident.span);
93+
}
9194
}
9295
}
9396

0 commit comments

Comments
 (0)