Avoid linking to itself in implementors section of trait page
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user