Add lifetime's bounds in doc generation

This commit is contained in:
Guillaume Gomez 2016-05-15 15:29:44 +02:00
parent 1a26d2364f
commit 391ae7f37a

View file

@ -795,7 +795,17 @@ impl Clean<Lifetime> for hir::Lifetime {
impl Clean<Lifetime> for hir::LifetimeDef {
fn clean(&self, _: &DocContext) -> Lifetime {
Lifetime(self.lifetime.name.to_string())
if self.bounds.len() > 0 {
let mut s = format!("{}: {}",
self.lifetime.name.to_string(),
self.bounds[0].name.to_string());
for bound in self.bounds.iter().skip(1) {
s.push_str(&format!(" + {}", bound.name.to_string()));
}
Lifetime(s)
} else {
Lifetime(self.lifetime.name.to_string())
}
}
}