Skip to content

Commit 8dfbefe

Browse files
authored
Unrolled build for #153627
Rollup merge of #153627 - aDotInTheVoid:rustdocsdocs, r=GuillaumeGomez rustdoc-json: Improve docs for `ItemEnum::item_kind` Fixes #153279 (comment) r? @GuillaumeGomez CC @LukeMathWalker
2 parents 3bc6ea5 + ca9bd0d commit 8dfbefe

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)