Skip to content

Conversation

@yotamofek
Copy link
Contributor

@yotamofek yotamofek commented Nov 29, 2025

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Nov 29, 2025
@yotamofek
Copy link
Contributor Author

yotamofek commented Nov 29, 2025

@lolbinarycat Felt like doing something semi-mechanical that doesn't require too much concentration, so thought I'd tackle the issue you opened.

But TBH, after pulling out the common code into an IndexItem constructor, I'm not sure it makes much sense and/or is worth it.
What do you think?

@rust-log-analyzer

This comment has been minimized.

@yotamofek yotamofek force-pushed the pr/rustdoc/IndexItem-new branch 2 times, most recently from 32d0484 to 6cedf2c Compare November 29, 2025 17:13
Comment on lines 161 to 164
let desc = short_markdown_summary(&item.doc_value(), &item.link_names(cache));
let search_type = get_function_type_for_search(item, tcx, impl_generics, parent_did, cache);
let aliases = item.attrs.get_doc_aliases();
let deprecation = item.deprecation(tcx);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to extract this subset of fields into a separate struct and include is a field on IndexItem?
Then maybe its constructor won't have to handle so many differences in behavior between the two call sites

@rust-log-analyzer

This comment has been minimized.

@lolbinarycat
Copy link
Contributor

It was working on #149460 that inspired this issue, and I agree that perhaps a substruct would be a better approach.

@yotamofek yotamofek force-pushed the pr/rustdoc/IndexItem-new branch from 6cedf2c to acd4d7e Compare December 12, 2025 22:32
@yotamofek
Copy link
Contributor Author

What do you think about how it looks now? @lolbinarycat
(still need to find a better name for the "sub struct")

@yotamofek
Copy link
Contributor Author

the amount of times I typed "sub stract" instead of "sub struct"....... 😤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants