8000 rustdoc: Speed up `TypeAliasPart::get` by nnethercote · Pull Request #141421 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

rustdoc: Speed up TypeAliasPart::get #141421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000
Diff view
Diff view
Prev Previous commit
Simplify things a little more.
  • Loading branch information
nnethercote committed May 23, 2025
commit dfe8fe88f03e1d72b170b7cd056026e0a932c5be
9 changes: 3 additions & 6 deletions src/librustdoc/html/render/write_shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ impl TypeAliasPart {
.impl_
.values()
.flat_map(|AliasedTypeImpl { impl_, type_aliases }| {
let mut ret = Vec::new();
let mut ret: Vec<AliasSerializableImpl> = Vec::new();
let trait_ = impl_
.inner_impl()
.trait_
Expand All @@ -624,11 +624,8 @@ impl TypeAliasPart {
cx.id_map.borrow_mut().clear();
cx.deref_id_map.borrow_mut().clear();
let type_alias_fqp = (*type_alias_fqp).iter().join("::");
if ret.last().map(|s: &AliasSerializableImpl| &s.text).is_some() {
ret.last_mut()
.expect("already established that ret.last() is Some()")
.aliases
.push(type_alias_fqp);
if let Some(last) = ret.last_mut() {
last.aliases.push(type_alias_fqp);
} else {
let target_did = impl_
.inner_impl()
Expand Down
Loading
0