Skip to content

Commit b3f9795

Browse files
committed
Get rid of clean::TyMethod
It's the same as clean::Function.
1 parent 9b2b02a commit b3f9795

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

src/librustdoc/clean/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
11201120
(self.generics.clean(cx), (&*sig.decl, &names[..]).clean(cx))
11211121
});
11221122
let (all_types, ret_types) = get_all_types(&generics, &decl, cx);
1123-
let mut t = TyMethod { header: sig.header, decl, generics, all_types, ret_types };
1123+
let mut t = Function { header: sig.header, decl, generics, all_types, ret_types };
11241124
if t.header.constness == hir::Constness::Const
11251125
&& is_unstable_const_fn(cx.tcx, local_did.to_def_id()).is_some()
11261126
{
@@ -1249,7 +1249,7 @@ impl Clean<Item> for ty::AssocItem {
12491249
ret_types,
12501250
})
12511251
} else {
1252-
TyMethodItem(TyMethod {
1252+
TyMethodItem(Function {
12531253
generics,
12541254
decl,
12551255
header: hir::FnHeader {

src/librustdoc/clean/types.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ crate enum ItemKind {
264264
ImplItem(Impl),
265265
/// A method signature only. Used for required methods in traits (ie,
266266
/// non-default-methods).
267-
TyMethodItem(TyMethod),
267+
TyMethodItem(Function),
268268
/// A method with a body.
269269
MethodItem(Method),
270270
StructFieldItem(Type),
@@ -920,15 +920,6 @@ crate struct Method {
920920
crate ret_types: Vec<(Type, TypeKind)>,
921921
}
922922

923-
#[derive(Clone, Debug)]
924-
crate struct TyMethod {
925-
crate header: hir::FnHeader,
926-
crate decl: FnDecl,
927-
crate generics: Generics,
928-
crate all_types: Vec<(Type, TypeKind)>,
929-
crate ret_types: Vec<(Type, TypeKind)>,
930-
}
931-
932923
#[derive(Clone, Debug)]
933924
crate struct Function {
934925
crate decl: FnDecl,

src/librustdoc/html/render/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3752,8 +3752,7 @@ fn render_impl(
37523752
(true, " hidden")
37533753
};
37543754
match item.kind {
3755-
clean::MethodItem(clean::Method { .. })
3756-
| clean::TyMethodItem(clean::TyMethod { .. }) => {
3755+
clean::MethodItem(_) | clean::TyMethodItem(_) => {
37573756
// Only render when the method is not static or we allow static methods
37583757
if render_method_item {
37593758
let id = cx.derive_id(format!("{}.{}", item_type, name));

0 commit comments

Comments
 (0)