diff options
Diffstat (limited to 'src/librustdoc/clean.rs')
| -rw-r--r-- | src/librustdoc/clean.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs index 52dbba13ea8..ad7fcd6b0c8 100644 --- a/src/librustdoc/clean.rs +++ b/src/librustdoc/clean.rs @@ -19,6 +19,7 @@ use syntax::ast_map; use syntax::ast_util; use syntax::attr; use syntax::attr::AttributeMethods; +use syntax::codemap::Pos; use rustc::metadata::cstore; use rustc::metadata::csearch; @@ -289,6 +290,14 @@ impl Clean<TyParamBound> for ast::TyParamBound { #[deriving(Clone, Encodable, Decodable)] pub struct Lifetime(~str); +impl Lifetime { + pub fn get_ref<'a>(&'a self) -> &'a str { + let Lifetime(ref s) = *self; + let s: &'a str = *s; + return s; + } +} + impl Clean<Lifetime> for ast::Lifetime { fn clean(&self) -> Lifetime { Lifetime(self.ident.clean()) @@ -798,9 +807,9 @@ impl Clean<Span> for syntax::codemap::Span { Span { filename: filename.to_owned(), loline: lo.line, - locol: *lo.col, + locol: lo.col.to_uint(), hiline: hi.line, - hicol: *hi.col, + hicol: hi.col.to_uint(), } } } |
