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

View File

@ -509,7 +509,7 @@ pub fn run(mut krate: clean::Crate,
} = renderinfo; } = renderinfo;
let external_paths = external_paths.into_iter() 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(); .collect();
let mut cache = Cache { let mut cache = Cache {