diff options
| author | Philipp Krones <hello@philkrones.com> | 2025-01-28 18:28:57 +0100 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2025-01-28 19:14:45 +0100 |
| commit | 145d5adf04fecbc48bdf2ab2a356ca4c8df0c149 (patch) | |
| tree | 1783d720a01e7ef83d143293961fd83200728556 /clippy_lints/src/default_numeric_fallback.rs | |
| parent | c5196736b27a32b688b957f2937dd4affadbe14f (diff) | |
| parent | 25509e71359ea0b218309d4b7e94bf40e1ef716e (diff) | |
| download | rust-145d5adf04fecbc48bdf2ab2a356ca4c8df0c149.tar.gz rust-145d5adf04fecbc48bdf2ab2a356ca4c8df0c149.zip | |
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'clippy_lints/src/default_numeric_fallback.rs')
| -rw-r--r-- | clippy_lints/src/default_numeric_fallback.rs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/clippy_lints/src/default_numeric_fallback.rs b/clippy_lints/src/default_numeric_fallback.rs index c04a73c890f..ca3eaae7b85 100644 --- a/clippy_lints/src/default_numeric_fallback.rs +++ b/clippy_lints/src/default_numeric_fallback.rs @@ -223,19 +223,17 @@ impl<'tcx> Visitor<'tcx> for NumericFallbackVisitor<'_, 'tcx> { } fn visit_pat(&mut self, pat: &'tcx Pat<'_>) { - match pat.kind { - PatKind::Expr(&PatExpr { - hir_id, - kind: PatExprKind::Lit { lit, .. }, - .. - }) => { - let ty = self.cx.typeck_results().node_type(hir_id); - self.check_lit(lit, ty, hir_id); - return; - }, - _ => {}, + if let PatKind::Expr(&PatExpr { + hir_id, + kind: PatExprKind::Lit { lit, .. }, + .. + }) = pat.kind + { + let ty = self.cx.typeck_results().node_type(hir_id); + self.check_lit(lit, ty, hir_id); + return; } - walk_pat(self, pat) + walk_pat(self, pat); } fn visit_stmt(&mut self, stmt: &'tcx Stmt<'_>) { |
