Remove GetDefId
impl for FnRetTy
It was only used in one place, so it seems better to use ordinary functions.
This commit is contained in:
parent
1da8659fa6
commit
6d82ee839d
2 changed files with 5 additions and 12 deletions
|
@ -1370,17 +1370,10 @@ crate enum FnRetTy {
|
|||
DefaultReturn,
|
||||
}
|
||||
|
||||
impl GetDefId for FnRetTy {
|
||||
fn def_id(&self) -> Option<DefId> {
|
||||
match *self {
|
||||
Return(ref ty) => ty.def_id(),
|
||||
DefaultReturn => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn def_id_full(&self, cache: &Cache) -> Option<DefId> {
|
||||
match *self {
|
||||
Return(ref ty) => ty.def_id_full(cache),
|
||||
impl FnRetTy {
|
||||
crate fn as_return(&self) -> Option<&Type> {
|
||||
match self {
|
||||
Return(ret) => Some(ret),
|
||||
DefaultReturn => None,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1215,7 +1215,7 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool, tcx: TyCtxt<'_>) ->
|
|||
fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String {
|
||||
let mut out = Buffer::html();
|
||||
|
||||
if let Some(did) = decl.output.def_id_full(cx.cache()) {
|
||||
if let Some(did) = decl.output.as_return().and_then(|t| t.def_id_full(cx.cache())) {
|
||||
if let Some(impls) = cx.cache().impls.get(&did) {
|
||||
for i in impls {
|
||||
let impl_ = i.inner_impl();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue