Add early-return when checking if a path is local
This commit is contained in:
parent
20200f65ca
commit
6c4eadd747
1 changed files with 4 additions and 2 deletions
|
@ -223,7 +223,9 @@ fn path_has_local_parent(
|
||||||
impl_parent_parent: Option<DefId>,
|
impl_parent_parent: Option<DefId>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
path.res.opt_def_id().is_some_and(|did| {
|
path.res.opt_def_id().is_some_and(|did| {
|
||||||
|
did.is_local() && {
|
||||||
let res_parent = cx.tcx.parent(did);
|
let res_parent = cx.tcx.parent(did);
|
||||||
res_parent == impl_parent || Some(res_parent) == impl_parent_parent
|
res_parent == impl_parent || Some(res_parent) == impl_parent_parent
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue