Skip to content

Commit 6d67468

Browse files
committed
Auto merge of rust-lang#127524 - oli-obk:feed_item_attrs2, r=petrochenkov
Make ast `MutVisitor` have the same method name and style as `Visitor` It doesn't map 100% because some `MutVisitor` methods can filter or even expand to multiple items, but consistency seems nicer. tracking issue: rust-lang#127615
2 parents e2a7000 + 221ac86 commit 6d67468

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/unnested_or_patterns.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn remove_all_parens(pat: &mut P<Pat>) {
121121
struct Visitor;
122122
impl MutVisitor for Visitor {
123123
fn visit_pat(&mut self, pat: &mut P<Pat>) {
124-
noop_visit_pat(pat, self);
124+
walk_pat(self, pat);
125125
let inner = match &mut pat.kind {
126126
Paren(i) => mem::replace(&mut i.kind, Wild),
127127
_ => return,
@@ -138,7 +138,7 @@ fn insert_necessary_parens(pat: &mut P<Pat>) {
138138
impl MutVisitor for Visitor {
139139
fn visit_pat(&mut self, pat: &mut P<Pat>) {
140140
use ast::BindingMode;
141-
noop_visit_pat(pat, self);
141+
walk_pat(self, pat);
142142
let target = match &mut pat.kind {
143143
// `i @ a | b`, `box a | b`, and `& mut? a | b`.
144144
Ident(.., Some(p)) | Box(p) | Ref(p, _) if matches!(&p.kind, Or(ps) if ps.len() > 1) => p,
@@ -160,7 +160,7 @@ fn unnest_or_patterns(pat: &mut P<Pat>) -> bool {
160160
impl MutVisitor for Visitor {
161161
fn visit_pat(&mut self, p: &mut P<Pat>) {
162162
// This is a bottom up transformation, so recurse first.
163-
noop_visit_pat(p, self);
163+
walk_pat(self, p);
164164

165165
// Don't have an or-pattern? Just quit early on.
166166
let Or(alternatives) = &mut p.kind else { return };
@@ -189,7 +189,7 @@ fn unnest_or_patterns(pat: &mut P<Pat>) -> bool {
189189

190190
// Deal with `Some(Some(0)) | Some(Some(1))`.
191191
if this_level_changed {
192-
noop_visit_pat(p, self);
192+
walk_pat(self, p);
193193
}
194194
}
195195
}

0 commit comments

Comments
 (0)