]> git.lizzy.rs Git - rust.git/commitdiff
Few improvements
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 29 May 2018 13:38:31 +0000 (15:38 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 4 Jun 2018 07:51:41 +0000 (09:51 +0200)
src/librustdoc/clean/mod.rs
src/librustdoc/html/render.rs

index ab03fe302b4a381a2e1ef368fa349d4f6c7d29dc..178a85f9364de71457c8500be459320f19495708 100644 (file)
@@ -196,16 +196,16 @@ fn clean(&self, cx: &DocContext) -> Crate {
                     inner: PrimitiveItem(prim),
                 }
             }));
-            m.items.extend(keywords.iter().map(|&(def_id, ref kw, ref attrs)| {
+            m.items.extend(keywords.into_iter().map(|(def_id, kw, attrs)| {
                 Item {
                     source: Span::empty(),
                     name: Some(kw.clone()),
-                    attrs: attrs.clone(),
+                    attrs: attrs,
                     visibility: Some(Public),
                     stability: get_stability(cx, def_id),
                     deprecation: get_deprecation(cx, def_id),
                     def_id,
-                    inner: KeywordItem(kw.clone()),
+                    inner: KeywordItem(kw),
                 }
             }));
         }
@@ -330,7 +330,6 @@ fn clean(&self, cx: &DocContext) -> ExternalCrate {
                     hir::ItemUse(ref path, hir::UseKind::Single)
                     if item.vis == hir::Visibility::Public => {
                         as_keyword(path.def).map(|(_, prim, attrs)| {
-                            // Pretend the primitive is local.
                             (cx.tcx.hir.local_def_id(id.id), prim, attrs)
                         })
                     }
index 123e6fc53ad3165da63f68960220b5f18eb35510..60178e6e7a4e0db93e5ef3eafa40e66da14d97be 100644 (file)
@@ -1557,7 +1557,7 @@ fn new() -> AllTypes {
             typedefs: HashSet::with_capacity(100),
             statics: HashSet::with_capacity(100),
             constants: HashSet::with_capacity(100),
-            keywords: HashSet::with_capacity(10),
+            keywords: HashSet::with_capacity(100),
         }
     }