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:
@@ -1370,17 +1370,10 @@ crate enum FnRetTy {
|
|||||||
DefaultReturn,
|
DefaultReturn,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GetDefId for FnRetTy {
|
impl FnRetTy {
|
||||||
fn def_id(&self) -> Option<DefId> {
|
crate fn as_return(&self) -> Option<&Type> {
|
||||||
match *self {
|
match self {
|
||||||
Return(ref ty) => ty.def_id(),
|
Return(ret) => Some(ret),
|
||||||
DefaultReturn => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn def_id_full(&self, cache: &Cache) -> Option<DefId> {
|
|
||||||
match *self {
|
|
||||||
Return(ref ty) => ty.def_id_full(cache),
|
|
||||||
DefaultReturn => None,
|
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 {
|
fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String {
|
||||||
let mut out = Buffer::html();
|
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) {
|
if let Some(impls) = cx.cache().impls.get(&did) {
|
||||||
for i in impls {
|
for i in impls {
|
||||||
let impl_ = i.inner_impl();
|
let impl_ = i.inner_impl();
|
||||||
|
|||||||
Reference in New Issue
Block a user