Turn all commented links before functions into doccomments (#40331)

Servo has a lot of comments like this:
```rust
// https://example-spec.com/#do-the-thing
fn do_the_thing() {}
```
and I keep turning these into doc comments whenever I'm working close to
one of them. Doing so allows me to hover over a function call in an IDE
and open its specification without having to jump to the function
definition first. This change fixes all of these comments at once.

This was done using `find components -name '*.rs' -exec perl -i -0777
-pe 's|^([ \t]*)// (https?://.*)\n\1(fn )|\1/// <$2>\n\1$3|mg' {} +`.

Note that these comments should be doc comments even within trait `impl`
blocks, because rustdoc will use them as fallback documentation when the
method definition on the trait does not have documentation.

Testing: Comments only, no testing required
Preparation for https://github.com/servo/servo/pull/39552

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker
2025-11-01 06:32:45 +01:00
committed by GitHub
parent a45be06779
commit c4ae451612
240 changed files with 2036 additions and 2035 deletions

View File

@@ -164,7 +164,7 @@ impl HTMLSelectElement {
})
}
// https://html.spec.whatwg.org/multipage/#placeholder-label-option
/// <https://html.spec.whatwg.org/multipage/#placeholder-label-option>
fn get_placeholder_label_option(&self) -> Option<DomRoot<HTMLOptionElement>> {
if self.Required() && !self.Multiple() && self.display_size() == 1 {
self.list_of_options().next().filter(|node| {
@@ -242,7 +242,7 @@ impl HTMLSelectElement {
}
}
// https://html.spec.whatwg.org/multipage/#concept-select-size
/// <https://html.spec.whatwg.org/multipage/#concept-select-size>
fn display_size(&self) -> u32 {
if self.Size() == 0 {
if self.Multiple() { 4 } else { 1 }