]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/highlight.rs
remove `get_ident` and `get_name`, make `as_str` sound
[rust.git] / src / librustdoc / html / highlight.rs
index e375ec3afc2545a7c5259e87ab35c6bd1b2878ec..3facaef7b287f761f7433e806c5c8453097de564 100644 (file)
@@ -75,7 +75,7 @@ fn doit(sess: &parse::ParseSess, mut lexer: lexer::StringReader,
                 continue
             },
             token::Shebang(s) => {
-                try!(write!(out, "{}", Escape(s.as_str())));
+                try!(write!(out, "{}", Escape(&s.as_str())));
                 continue
             },
             // If this '&' token is directly adjacent to another token, assume
@@ -141,7 +141,7 @@ fn doit(sess: &parse::ParseSess, mut lexer: lexer::StringReader,
 
             // keywords are also included in the identifier set
             token::Ident(ident, _is_mod_sep) => {
-                match &token::get_ident(ident)[..] {
+                match &*ident.name.as_str() {
                     "ref" | "mut" => "kw-2",
 
                     "self" => "self",