We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
manual_range_patterns
1 parent 2309f8e commit 44f87e8Copy full SHA for 44f87e8
clippy_lints/src/manual_range_patterns.rs
@@ -76,14 +76,11 @@ impl Num {
76
77
impl LateLintPass<'_> for ManualRangePatterns {
78
fn check_pat(&mut self, cx: &LateContext<'_>, pat: &'_ rustc_hir::Pat<'_>) {
79
- if in_external_macro(cx.sess(), pat.span) {
80
- return;
81
- }
82
-
83
// a pattern like 1 | 2 seems fine, lint if there are at least 3 alternatives
84
// or at least one range
85
if let PatKind::Or(pats) = pat.kind
86
&& (pats.len() >= 3 || pats.iter().any(|p| matches!(p.kind, PatKind::Range(..))))
+ && !in_external_macro(cx.sess(), pat.span)
87
{
88
let mut min = Num::dummy(i128::MAX);
89
let mut max = Num::dummy(i128::MIN);
0 commit comments