use OnlyBodies instead of All

we only need to check closures, so
nestedfilter::All was overkill here.
This commit is contained in:
Eric Wu 2023-01-02 18:35:21 -05:00
parent 8de011fdf7
commit cf4e9813b0

View file

@ -1262,7 +1262,7 @@ pub struct ContainsName<'a, 'tcx> {
} }
impl<'a, 'tcx> Visitor<'tcx> for ContainsName<'a, 'tcx> { impl<'a, 'tcx> Visitor<'tcx> for ContainsName<'a, 'tcx> {
type NestedFilter = nested_filter::All; type NestedFilter = nested_filter::OnlyBodies;
fn visit_name(&mut self, name: Symbol) { fn visit_name(&mut self, name: Symbol) {
if self.name == name { if self.name == name {