rustdoc: Remove Crate.src
and instead compute it on-demand
It is only used in one place; `src` was about a third of `Crate`'s total size; `Crate` is frequently moved by-value; and `src` can be easily computed on-demand.
This commit is contained in:
parent
47b0059dba
commit
85f8ae8ec4
3 changed files with 8 additions and 5 deletions
|
@ -57,7 +57,6 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
|
|||
}
|
||||
|
||||
let local_crate = ExternalCrate { crate_num: LOCAL_CRATE };
|
||||
let src = local_crate.src(cx.tcx);
|
||||
let name = local_crate.name(cx.tcx);
|
||||
let primitives = local_crate.primitives(cx.tcx);
|
||||
let keywords = local_crate.keywords(cx.tcx);
|
||||
|
@ -81,7 +80,6 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
|
|||
|
||||
Crate {
|
||||
name,
|
||||
src,
|
||||
module,
|
||||
externs,
|
||||
primitives,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue