mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
Rollup merge of #107244 - notriddle:notriddle/primitive-reference-link, r=GuillaumeGomez
rustdoc: rearrange HTML in primitive reference links This patch avoids hard-to-click single character links by making the generic part of the link: Before: <a href="#">&</a>T After: <a href="#">&T</a>
This commit is contained in:
commit
2ed3639f83
@ -1064,14 +1064,8 @@ fn fmt_type<'cx>(
|
||||
fmt_type(ty, f, use_absolute, cx)?;
|
||||
write!(f, ")")
|
||||
}
|
||||
clean::Generic(..) => {
|
||||
primitive_link(
|
||||
f,
|
||||
PrimitiveType::Reference,
|
||||
&format!("{}{}{}", amp, lt, m),
|
||||
cx,
|
||||
)?;
|
||||
fmt_type(ty, f, use_absolute, cx)
|
||||
clean::Generic(name) => {
|
||||
primitive_link(f, PrimitiveType::Reference, &format!("{amp}{lt}{m}{name}"), cx)
|
||||
}
|
||||
_ => {
|
||||
write!(f, "{}{}{}", amp, lt, m)?;
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="item-decl"><pre class="rust"><code>pub enum Cow<'a, B><span class="where fmt-newline">where<br />    B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a><dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>> + ?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a,</span>{
|
||||
Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&'a </a>B),
|
||||
Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&'a B</a>),
|
||||
Whatever(<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>),
|
||||
}</code></pre></div>
|
@ -1,4 +1,4 @@
|
||||
<div class="item-decl"><pre class="rust"><code>pub enum Cow2<'a, B: ?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a><dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>> + 'a> {
|
||||
Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&'a </a>B),
|
||||
Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&'a B</a>),
|
||||
Whatever(<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>),
|
||||
}</code></pre></div>
|
@ -1,4 +1,4 @@
|
||||
<div class="item-decl"><pre class="rust"><code>pub struct Struct<'a, B><span class="where fmt-newline">where<br />    B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a><dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>> + ?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a,</span>{
|
||||
pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&'a </a>B,
|
||||
pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&'a B</a>,
|
||||
pub b: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>,
|
||||
}</code></pre></div>
|
@ -1,4 +1,4 @@
|
||||
<div class="item-decl"><pre class="rust"><code>pub struct Struct2<'a, B: ?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a><dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>> + 'a> {
|
||||
pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&'a </a>B,
|
||||
pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&'a B</a>,
|
||||
pub b: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>,
|
||||
}</code></pre></div>
|
Loading…
Reference in New Issue
Block a user