Avoid linking to itself in implementors section of trait page

This commit is contained in:
Seo Sanghyeon
2016-03-29 01:11:08 +09:00
parent a11129701c
commit b308a8c036
3 changed files with 38 additions and 10 deletions

View File

@@ -1505,6 +1505,13 @@ impl Type {
_ => None,
}
}
pub fn trait_name(&self) -> Option<String> {
match *self {
ResolvedPath { ref path, .. } => Some(path.last_name()),
_ => None,
}
}
}
impl GetDefId for Type {
@@ -1994,6 +2001,10 @@ impl Path {
}]
}
}
pub fn last_name(&self) -> String {
self.segments.last().unwrap().name.clone()
}
}
impl Clean<Path> for hir::Path {