From 3d2fd5ec03ba0d57070d2df8b779cae295c91896 Mon Sep 17 00:00:00 2001 From: Kevin Walter Date: Fri, 11 Jul 2014 21:51:29 +0200 Subject: [PATCH] rustdoc: render 1-tuples as (T,) instead of (T) --- src/librustdoc/html/format.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 382e299d28d..f9b2fb50521 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -428,7 +428,10 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { } clean::Tuple(ref typs) => { primitive_link(f, clean::PrimitiveTuple, - format!("({:#})", typs).as_slice()) + match typs.as_slice() { + [ref one] => format!("({},)", one), + many => format!("({:#})", many) + }.as_slice()) } clean::Vector(ref t) => { primitive_link(f, clean::Slice, format!("[{}]", **t).as_slice())