Skip to content

Commit ca9bd0d

Browse files
committed
rustdoc-json: Improve docs for ItemEnum::item_kind
Fixes rust-lang#153279 (comment)
1 parent 2d76d9b commit ca9bd0d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/rustdoc-json-types/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,13 @@ pub enum ItemEnum {
683683
}
684684

685685
impl ItemEnum {
686-
/// Returns the [`ItemKind`] of this item.
686+
/// Get just the kind of this item, but with no further data.
687+
///
688+
/// ```rust
689+
/// # use rustdoc_json_types::{ItemKind, ItemEnum};
690+
/// let item = ItemEnum::ExternCrate { name: "libc".to_owned(), rename: None };
691+
/// assert_eq!(item.item_kind(), ItemKind::ExternCrate);
692+
/// ```
687693
pub fn item_kind(&self) -> ItemKind {
688694
match self {
689695
ItemEnum::Module(_) => ItemKind::Module,

0 commit comments

Comments
 (0)