Skip to content

Commit 904f492

Browse files
Few improvements
1 parent ebee483 commit 904f492

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/librustdoc/clean/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,16 @@ impl<'a, 'tcx, 'rcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx>
196196
inner: PrimitiveItem(prim),
197197
}
198198
}));
199-
m.items.extend(keywords.iter().map(|&(def_id, ref kw, ref attrs)| {
199+
m.items.extend(keywords.into_iter().map(|(def_id, kw, attrs)| {
200200
Item {
201201
source: Span::empty(),
202202
name: Some(kw.clone()),
203-
attrs: attrs.clone(),
203+
attrs: attrs,
204204
visibility: Some(Public),
205205
stability: get_stability(cx, def_id),
206206
deprecation: get_deprecation(cx, def_id),
207207
def_id,
208-
inner: KeywordItem(kw.clone()),
208+
inner: KeywordItem(kw),
209209
}
210210
}));
211211
}
@@ -330,7 +330,6 @@ impl Clean<ExternalCrate> for CrateNum {
330330
hir::ItemUse(ref path, hir::UseKind::Single)
331331
if item.vis == hir::Visibility::Public => {
332332
as_keyword(path.def).map(|(_, prim, attrs)| {
333-
// Pretend the primitive is local.
334333
(cx.tcx.hir.local_def_id(id.id), prim, attrs)
335334
})
336335
}

src/librustdoc/html/render.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ impl AllTypes {
15571557
typedefs: HashSet::with_capacity(100),
15581558
statics: HashSet::with_capacity(100),
15591559
constants: HashSet::with_capacity(100),
1560-
keywords: HashSet::with_capacity(10),
1560+
keywords: HashSet::with_capacity(100),
15611561
}
15621562
}
15631563

0 commit comments

Comments
 (0)