make impl_subject more readable
This commit is contained in:
parent
e2f5a5a71f
commit
8d5ee1a072
@ -105,12 +105,10 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
}
|
||||
|
||||
pub fn impl_subject(self, def_id: DefId) -> EarlyBinder<ImplSubject<'tcx>> {
|
||||
EarlyBinder(
|
||||
self.impl_trait_ref(def_id)
|
||||
.map(|t| t.subst_identity())
|
||||
.map(ImplSubject::Trait)
|
||||
.unwrap_or_else(|| ImplSubject::Inherent(self.type_of(def_id).subst_identity())),
|
||||
)
|
||||
match self.impl_trait_ref(def_id) {
|
||||
Some(t) => t.map_bound(ImplSubject::Trait),
|
||||
None => self.type_of(def_id).map_bound(ImplSubject::Inherent),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user