Skip to content

Commit 952e01e

Browse files
committed
rustdoc-search: show type signature on type-driven SERP
This displays the function signature, as rustdoc understands it, on the In Parameters, In Return Types, and In Function Signature pages, but not in the In Names page, since it's not used there. It also highlights the matching parts, to clarify why a function is considered a good match.
1 parent b67985e commit 952e01e

File tree

7 files changed

+561
-165
lines changed

7 files changed

+561
-165
lines changed

src/librustdoc/html/static/css/rustdoc.css

+5-3
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,11 @@ details:not(.toggle) summary {
328328
margin-bottom: .6em;
329329
}
330330

331-
code, pre, a.test-arrow, .code-header {
331+
code, pre, a.test-arrow, .code-header, .search-results .type-signature {
332332
font-family: "Source Code Pro", monospace;
333333
}
334-
.docblock code, .docblock-short code {
334+
.docblock code, .docblock-short code,
335+
.search-results .type-signature strong {
335336
border-radius: 3px;
336337
padding: 0 0.125em;
337338
}
@@ -681,7 +682,8 @@ ul.block, .block li {
681682
}
682683

683684
.docblock code, .docblock-short code,
684-
pre, .rustdoc.src .example-wrap {
685+
pre, .rustdoc.src .example-wrap,
686+
.search-results .type-signature strong {
685687
background-color: var(--code-block-background-color);
686688
}
687689

0 commit comments

Comments
 (0)