1
Fork 0

Fix rustdoc's formatting of lifetimes

rustdoc was previously formatting lifetimes with two apostrophes, presumably
as a result of #14797.
This commit is contained in:
P1start 2014-06-15 14:59:01 +12:00
parent 6d8342f5e9
commit 0204ca1726
2 changed files with 1 additions and 2 deletions

View file

@ -617,7 +617,7 @@ impl Clean<Lifetime> for ty::RegionParameterDef {
impl Clean<Option<Lifetime>> for ty::Region { impl Clean<Option<Lifetime>> for ty::Region {
fn clean(&self) -> Option<Lifetime> { fn clean(&self) -> Option<Lifetime> {
match *self { match *self {
ty::ReStatic => Some(Lifetime("static".to_string())), ty::ReStatic => Some(Lifetime("'static".to_string())),
ty::ReLateBound(_, ty::BrNamed(_, name)) => ty::ReLateBound(_, ty::BrNamed(_, name)) =>
Some(Lifetime(token::get_name(name).get().to_string())), Some(Lifetime(token::get_name(name).get().to_string())),
ty::ReEarlyBound(_, _, _, name) => Some(Lifetime(name.clean())), ty::ReEarlyBound(_, _, _, name) => Some(Lifetime(name.clean())),

View file

@ -91,7 +91,6 @@ impl fmt::Show for clean::Generics {
impl fmt::Show for clean::Lifetime { impl fmt::Show for clean::Lifetime {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(f.write("'".as_bytes()));
try!(f.write(self.get_ref().as_bytes())); try!(f.write(self.get_ref().as_bytes()));
Ok(()) Ok(())
} }