Restructure visit_ty in a more clear way
This commit is contained in:
parent
05b989e16e
commit
81c4d2371a
1 changed files with 9 additions and 6 deletions
|
@ -38,13 +38,16 @@ impl<'this, 'ast: 'this> Visitor<'ast> for LifetimeCollectVisitor<'this, 'ast> {
|
|||
}
|
||||
|
||||
fn visit_ty(&mut self, t: &'ast Ty) {
|
||||
if let TyKind::BareFn(_) = t.kind {
|
||||
match t.kind {
|
||||
TyKind::BareFn(_) => {
|
||||
self.current_binders.push(t.id);
|
||||
}
|
||||
visit::walk_ty(self, t);
|
||||
if let TyKind::BareFn(_) = t.kind {
|
||||
self.current_binders.pop();
|
||||
}
|
||||
_ => {
|
||||
visit::walk_ty(self, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue