X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustdoc%2Fformats%2Fitem_type.rs;h=2f1f4cbf3592457e7972dc043e04e6b86f27c3ae;hb=fa51fc01ca3d654d08d627b1d1482d1b77e5ed8b;hp=f21e60a64e0055f87060c44de8b5b492866deb66;hpb=37c352159755d8c7c9a35c653af3d4141c7d2680;p=rust.git diff --git a/src/librustdoc/formats/item_type.rs b/src/librustdoc/formats/item_type.rs index f21e60a64e0..2f1f4cbf359 100644 --- a/src/librustdoc/formats/item_type.rs +++ b/src/librustdoc/formats/item_type.rs @@ -177,6 +177,9 @@ pub(crate) fn as_str(&self) -> &'static str { ItemType::TraitAlias => "traitalias", } } + pub(crate) fn is_method(&self) -> bool { + matches!(*self, ItemType::Method | ItemType::TyMethod) + } } impl fmt::Display for ItemType {