Skip to content
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

rustdoc search: rank identity functions lower unless requested #132285

Closed
lolbinarycat opened this issue Oct 28, 2024 · 0 comments
Closed

rustdoc search: rank identity functions lower unless requested #132285

lolbinarycat opened this issue Oct 28, 2024 · 0 comments
Labels
A-rustdoc-search Area: Rustdoc's search feature A-type-based-search Area: Searching rustdoc pages using type signatures C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@lolbinarycat
Copy link
Contributor

whenever you perform a -> SomeType query, two results almost always show up in the top 5 results: SomeType::clone, and the reflexive SomeType::from.

when people perform this type of search, they are almost always doing it because they need a value of that type, and don't already have one.

I think that when there are no input arguments in a type-based search, we should rank items that take their return type as an argument below those that don't. if repeatedly checking the arguments of functions during sort has significant performance impact, we can amortize it by caching this property in the search index.

@lolbinarycat lolbinarycat added A-rustdoc-search Area: Rustdoc's search feature A-type-based-search Area: Searching rustdoc pages using type signatures C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Oct 28, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 28, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-search Area: Rustdoc's search feature A-type-based-search Area: Searching rustdoc pages using type signatures C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

No branches or pull requests

3 participants