Move lifetime_to_string to Display impl

This commit is contained in:
Mark Rousskov 2019-07-05 15:42:28 -04:00
parent a440337e2b
commit 11d521676f
2 changed files with 7 additions and 5 deletions

View file

@ -50,11 +50,17 @@ impl fmt::Debug for Lifetime {
f,
"lifetime({}: {})",
self.id,
pprust::lifetime_to_string(self)
self
)
}
}
impl fmt::Display for Lifetime {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.ident.name.as_str())
}
}
/// A "Path" is essentially Rust's notion of a name.
///
/// It's represented as a sequence of identifiers,