Skip to content

Commit b01e56d

Browse files
authored
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 531dafd + ca9bd0d commit b01e56d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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)