Skip to content

Commit aab7aef

Browse files
committed
Fix clippy
1 parent 143570b commit aab7aef

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/tools/clippy/clippy_lints/src/init_numbered_fields.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ declare_lint_pass!(NumberedFields => [INIT_NUMBERED_FIELDS]);
4343

4444
impl<'tcx> LateLintPass<'tcx> for NumberedFields {
4545
fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
46-
if let ExprKind::Struct(path, fields @ [field, ..], StructTailExpr::None) = e.kind
46+
if let ExprKind::Struct(path, fields @ [field, ..], StructTailExpr::None(_)) = e.kind
4747
// If the first character of any field is a digit it has to be a tuple.
4848
&& field.ident.as_str().as_bytes().first().is_some_and(u8::is_ascii_digit)
4949
// Type aliases can't be used as functions.

src/tools/clippy/clippy_lints/src/no_effect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ fn has_no_effect(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
239239
!has_drop(cx, cx.typeck_results().expr_ty(expr))
240240
&& fields.iter().all(|field| has_no_effect(cx, field.expr))
241241
&& match &base {
242-
StructTailExpr::None | StructTailExpr::DefaultFields(_) => true,
242+
StructTailExpr::None(_)| StructTailExpr::DefaultFields(_) => true,
243243
StructTailExpr::Base(base) => has_no_effect(cx, base),
244244
}
245245
},
@@ -347,7 +347,7 @@ fn reduce_expression<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<Vec
347347
} else {
348348
let base = match base {
349349
StructTailExpr::Base(base) => Some(base),
350-
StructTailExpr::None | StructTailExpr::DefaultFields(_) => None,
350+
StructTailExpr::None(_)| StructTailExpr::DefaultFields(_) => None,
351351
};
352352
Some(fields.iter().map(|f| &f.expr).chain(base).map(Deref::deref).collect())
353353
}

src/tools/clippy/clippy_lints/src/single_range_in_vec_init.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl LateLintPass<'_> for SingleRangeInVecInit {
8686
return;
8787
};
8888

89-
let ExprKind::Struct(QPath::LangItem(lang_item, ..), [start, end], StructTailExpr::None) = inner_expr.kind else {
89+
let ExprKind::Struct(QPath::LangItem(lang_item, ..), [start, end], StructTailExpr::None(_)) = inner_expr.kind else {
9090
return;
9191
};
9292

src/tools/clippy/clippy_lints/src/unnecessary_struct_initialization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl LateLintPass<'_> for UnnecessaryStruct {
5959
let field_path = same_path_in_all_fields(cx, expr, fields);
6060

6161
let sugg = match (field_path, base) {
62-
(Some(&path), StructTailExpr::None | StructTailExpr::DefaultFields(_)) => {
62+
(Some(&path), StructTailExpr::None(_)| StructTailExpr::DefaultFields(_)) => {
6363
// all fields match, no base given
6464
path.span
6565
},

src/tools/clippy/clippy_lints/src/utils/author.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
600600
bind!(self, qpath, fields);
601601
let base = OptionPat::new(match base {
602602
StructTailExpr::Base(base) => Some(self.bind("base", base)),
603-
StructTailExpr::None | StructTailExpr::DefaultFields(_) => None,
603+
StructTailExpr::None(_) | StructTailExpr::DefaultFields(_) => None,
604604
});
605605
kind!("Struct({qpath}, {fields}, {base})");
606606
self.qpath(qpath);

0 commit comments

Comments
 (0)