From ca9bd0d157819aeb46dc93bd4c6e9a9446841275 Mon Sep 17 00:00:00 2001 From: Alona Enraght-Moony Date: Mon, 9 Mar 2026 20:47:08 +0000 Subject: [PATCH] rustdoc-json: Improve docs for `ItemEnum::item_kind` Fixes https://github.com/rust-lang/rust/pull/153279#discussion_r2875219461 --- src/rustdoc-json-types/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 54fb833f40b64..72a3f8b224a48 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -683,7 +683,13 @@ pub enum ItemEnum { } impl ItemEnum { - /// Returns the [`ItemKind`] of this item. + /// Get just the kind of this item, but with no further data. + /// + /// ```rust + /// # use rustdoc_json_types::{ItemKind, ItemEnum}; + /// let item = ItemEnum::ExternCrate { name: "libc".to_owned(), rename: None }; + /// assert_eq!(item.item_kind(), ItemKind::ExternCrate); + /// ``` pub fn item_kind(&self) -> ItemKind { match self { ItemEnum::Module(_) => ItemKind::Module,