Skip to content

Commit 0c9ff54

Browse files
committed
Migrate ItemType::from_type_kind to convert::From.
1 parent 30397ae commit 0c9ff54

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/librustdoc/html/item_type.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ impl<'a> From<&'a clean::Item> for ItemType {
8585
}
8686
}
8787

88-
impl ItemType {
89-
pub fn from_type_kind(kind: clean::TypeKind) -> ItemType {
88+
impl From<clean::TypeKind> for ItemType {
89+
fn from(kind: clean::TypeKind) -> ItemType {
9090
match kind {
9191
clean::TypeStruct => ItemType::Struct,
9292
clean::TypeEnum => ItemType::Enum,
@@ -99,7 +99,9 @@ impl ItemType {
9999
clean::TypeTypedef => ItemType::Typedef,
100100
}
101101
}
102+
}
102103

104+
impl ItemType {
103105
pub fn css_class(&self) -> &'static str {
104106
match *self {
105107
ItemType::Module => "mod",

src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ pub fn run(mut krate: clean::Crate,
509509
} = renderinfo;
510510

511511
let external_paths = external_paths.into_iter()
512-
.map(|(k, (v, t))| (k, (v, ItemType::from_type_kind(t))))
512+
.map(|(k, (v, t))| (k, (v, ItemType::from(t))))
513513
.collect();
514514

515515
let mut cache = Cache {

0 commit comments

Comments
 (0)