Migrate ItemType::from_type_kind to convert::From.
This commit is contained in:
parent
30397aee0d
commit
0c9ff54139
@ -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",
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user