Skip to content

Commit 3d2fd5e

Browse files
committed
rustdoc: render 1-tuples as (T,) instead of (T)
1 parent aeab250 commit 3d2fd5e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustdoc/html/format.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,10 @@ impl fmt::Show for clean::Type {
428428
}
429429
clean::Tuple(ref typs) => {
430430
primitive_link(f, clean::PrimitiveTuple,
431-
format!("({:#})", typs).as_slice())
431+
match typs.as_slice() {
432+
[ref one] => format!("({},)", one),
433+
many => format!("({:#})", many)
434+
}.as_slice())
432435
}
433436
clean::Vector(ref t) => {
434437
primitive_link(f, clean::Slice, format!("[{}]", **t).as_slice())

0 commit comments

Comments
 (0)