]> git.lizzy.rs Git - rust.git/commitdiff
Fix some fallout in librustdoc
authorSimonas Kazlauskas <git@kazlauskas.me>
Tue, 24 Mar 2015 22:39:29 +0000 (00:39 +0200)
committerSimonas Kazlauskas <git@kazlauskas.me>
Tue, 24 Mar 2015 22:39:29 +0000 (00:39 +0200)
src/librustdoc/html/format.rs
src/librustdoc/html/render.rs
src/librustdoc/visit_ast.rs

index df6beab0f5832ebc75bbfdf62fbd0b6a412bbeef..0e6e008c616523f9a47dea6078179f59f54d3955 100644 (file)
@@ -290,7 +290,7 @@ fn resolved_path(w: &mut fmt::Formatter, did: ast::DefId, p: &clean::Path,
             if ast_util::is_local(did) || cache.inlined.contains(&did) {
                 Some(repeat("../").take(loc.len()).collect::<String>())
             } else {
-                match cache.extern_locations[&did.krate] {
+                match cache.extern_locations[did.krate] {
                     render::Remote(ref s) => Some(s.to_string()),
                     render::Local => {
                         Some(repeat("../").take(loc.len()).collect::<String>())
@@ -404,11 +404,11 @@ fn primitive_link(f: &mut fmt::Formatter,
             needs_termination = true;
         }
         Some(&cnum) => {
-            let path = &m.paths[&ast::DefId {
+            let path = &m.paths[ast::DefId {
                 krate: cnum,
                 node: ast::CRATE_NODE_ID,
             }];
-            let loc = match m.extern_locations[&cnum] {
+            let loc = match m.extern_locations[cnum] {
                 render::Remote(ref s) => Some(s.to_string()),
                 render::Local => {
                     let len = CURRENT_LOCATION_KEY.with(|s| s.borrow().len());
index d57739c4002494165c4f48cf4fbc7abbce720425..28dfe8dca7d38c985f9dd8bcb0fa8eb918bea0c2 100644 (file)
@@ -1409,8 +1409,8 @@ fn href(&self, cx: &Context) -> Option<String> {
         // located, then we return `None`.
         } else {
             let cache = cache();
-            let path = &cache.external_paths[&self.item.def_id];
-            let root = match cache.extern_locations[&self.item.def_id.krate] {
+            let path = &cache.external_paths[self.item.def_id];
+            let root = match cache.extern_locations[self.item.def_id.krate] {
                 Remote(ref s) => s.to_string(),
                 Local => self.cx.root_path.clone(),
                 Unknown => return None,
@@ -1868,7 +1868,7 @@ fn trait_item(w: &mut fmt::Formatter, m: &clean::Item)
                 path = if ast_util::is_local(it.def_id) {
                     cx.current.connect("/")
                 } else {
-                    let path = &cache.external_paths[&it.def_id];
+                    let path = &cache.external_paths[it.def_id];
                     path[..path.len() - 1].connect("/")
                 },
                 ty = shortty(it).to_static_str(),
index 11e10cc2aa7a16cf004fdb8933d7e47283df978d..d53954b29b585422bc3305b821476fa41e8e45e8 100644 (file)
@@ -196,7 +196,7 @@ fn resolve_id(&mut self, id: ast::NodeId, renamed: Option<ast::Ident>,
             Some(tcx) => tcx,
             None => return false
         };
-        let def = tcx.def_map.borrow()[&id].def_id();
+        let def = tcx.def_map.borrow()[id].def_id();
         if !ast_util::is_local(def) { return false }
         let analysis = match self.analysis {
             Some(analysis) => analysis, None => return false