Migrate ItemType::from_type_kind to convert::From.

This commit is contained in:
Corey Farwell 2016-08-20 15:55:43 -04:00
parent 30397aee0d
commit 0c9ff54139
2 changed files with 5 additions and 3 deletions

View File

@ -85,8 +85,8 @@ impl<'a> From<&'a clean::Item> for ItemType {
}
}
impl ItemType {
pub fn from_type_kind(kind: clean::TypeKind) -> ItemType {
impl From<clean::TypeKind> for ItemType {
fn from(kind: clean::TypeKind) -> ItemType {
match kind {
clean::TypeStruct => ItemType::Struct,
clean::TypeEnum => ItemType::Enum,
@ -99,7 +99,9 @@ impl ItemType {
clean::TypeTypedef => ItemType::Typedef,
}
}
}
impl ItemType {
pub fn css_class(&self) -> &'static str {
match *self {
ItemType::Module => "mod",

View File

@ -509,7 +509,7 @@ pub fn run(mut krate: clean::Crate,
} = renderinfo;
let external_paths = external_paths.into_iter()
.map(|(k, (v, t))| (k, (v, ItemType::from_type_kind(t))))
.map(|(k, (v, t))| (k, (v, ItemType::from(t))))
.collect();
let mut cache = Cache {