Skip to content

Commit 617e64c

Browse files
committed
Update code format and tests
1 parent b7a8f1f commit 617e64c

File tree

7 files changed

+9
-10
lines changed

7 files changed

+9
-10
lines changed

src/librustdoc/html/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ impl clean::FnDecl {
14311431
cx: &Context<'_>,
14321432
) -> fmt::Result {
14331433
let amp = if f.alternate() { "&" } else { "&amp;" };
1434-
1434+
14351435
write!(f, "(")?;
14361436
if let Some(n) = line_wrapping_indent
14371437
&& !self.inputs.values.is_empty()
@@ -1483,7 +1483,7 @@ impl clean::FnDecl {
14831483

14841484
if self.c_variadic {
14851485
match line_wrapping_indent {
1486-
None => write!(f, "...")?,
1486+
None => write!(f, ", ...")?,
14871487
Some(n) => write!(f, "{}...\n", Indent(n + 4))?,
14881488
};
14891489
}

tests/rustdoc/async-fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct AsyncFdReadyGuard<'a, T> { x: &'a T }
7979

8080
impl Foo {
8181
// @has async_fn/struct.Foo.html
82-
// @has - '//*[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar ) -> impl Iterator<Item = &usize>'
82+
// @has - '//*[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar, ) -> impl Iterator<Item = &usize>'
8383
pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator<Item = &usize> {
8484
[0].iter()
8585
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
<pre class="rust item-decl"><code>pub fn create(
2-
) -&gt; <a class="struct" href="struct.Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000.html" title="struct decl_line_wrapping_empty_arg_list::Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000">Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000</a></code></pre>
1+
<pre class="rust item-decl"><code>pub fn create() -&gt; <a class="struct" href="struct.Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000.html" title="struct decl_line_wrapping_empty_arg_list::Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000">Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000</a></code></pre>

tests/rustdoc/decl-trailing-whitespace.declaration.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fn <a href="#tymethod.poll_write" class="fn">poll_write</a>(
44
self,
55
cx: &amp;mut <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;,
6-
buf: &amp;mut [<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>]
6+
buf: &amp;mut [<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>],
77
) -&gt; <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="{{channel}}/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>, <a class="struct" href="struct.Error.html" title="struct foo::Error">Error</a>&gt;&gt;;
88
<span class="item-spacer" /> fn <a href="#tymethod.poll_flush" class="fn">poll_flush</a>(self, cx: &amp;mut <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;) -&gt; <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="{{channel}}/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct foo::Error">Error</a>&gt;&gt;;
99
<span class="item-spacer" /> fn <a href="#tymethod.poll_close" class="fn">poll_close</a>(self, cx: &amp;mut <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;) -&gt; <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="{{channel}}/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct foo::Error">Error</a>&gt;&gt;;
@@ -12,6 +12,6 @@
1212
fn <a href="#method.poll_write_vectored" class="fn">poll_write_vectored</a>(
1313
self,
1414
cx: &amp;mut <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;,
15-
bufs: &amp;[<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>]
15+
bufs: &amp;[<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>],
1616
) -&gt; <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="{{channel}}/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>, <a class="struct" href="struct.Error.html" title="struct foo::Error">Error</a>&gt;&gt; { ... }
1717
}</code>

tests/rustdoc/inline_cross/impl_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub use impl_trait_aux::func;
1111
// @has impl_trait/fn.func2.html
1212
// @has - '//pre[@class="rust item-decl"]' "func2<T>("
1313
// @has - '//pre[@class="rust item-decl"]' "_x: impl Deref<Target = Option<T>> + Iterator<Item = T>,"
14-
// @has - '//pre[@class="rust item-decl"]' "_y: impl Iterator<Item = u8> )"
14+
// @has - '//pre[@class="rust item-decl"]' "_y: impl Iterator<Item = u8>, )"
1515
// @!has - '//pre[@class="rust item-decl"]' 'where'
1616
pub use impl_trait_aux::func2;
1717

tests/rustdoc/line-breaks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::ops::Add;
66
// @matches foo/fn.function_with_a_really_long_name.html '//*[@class="rust item-decl"]//code' "\
77
// function_with_a_really_long_name\(\n\
88
// \ parameter_one: i32,\n\
9-
// \ parameter_two: i32\n\
9+
// \ parameter_two: i32,\n\
1010
// \) -> Option<i32>$"
1111
pub fn function_with_a_really_long_name(parameter_one: i32, parameter_two: i32) -> Option<i32> {
1212
Some(parameter_one + parameter_two)

tests/rustdoc/reexports-priv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub mod outer {
9898
pub use reexports::foo;
9999
// @has 'foo/outer/inner/fn.foo_crate.html' '//pre[@class="rust item-decl"]' 'pub(crate) fn foo_crate()'
100100
pub(crate) use reexports::foo_crate;
101-
// @has 'foo/outer/inner/fn.foo_super.html' '//pre[@class="rust item-decl"]' 'pub(in outer) fn foo_super( )'
101+
// @has 'foo/outer/inner/fn.foo_super.html' '//pre[@class="rust item-decl"]' 'pub(in outer) fn foo_super()'
102102
pub(super) use::reexports::foo_super;
103103
// @!has 'foo/outer/inner/fn.foo_self.html'
104104
pub(self) use reexports::foo_self;

0 commit comments

Comments
 (0)