Uh oh!
There was an error while loading. Please reload this page.
Change tuple Debug impls to use builders - #26913
Conversation
bluss
commented
Jul 9, 2015
Since it's using a macro, we could special case the unary tuple, so that we get the comma anyway? |
alexcrichton
commented
Jul 9, 2015
Yeah I think I'd prefer to keep the trailing comma on 1-tuples, but other than that r=me |
nagisa
commented
Jul 10, 2015
Would be nice to keep Debug output as close to something that compiles. |
sfackler
commented
Jul 10, 2015
Updated |
alexcrichton
commented
Jul 10, 2015
In the interest of not having lingering unstable methods, could this do what @bluss mentioned and special case the 1-tuple case? |
sfackler
commented
Jul 10, 2015
The machinery involved to properly handle the pretty case is involved enough (e.g. see |
bluss
commented
Jul 11, 2015
Yes on a closer look it's not easy, I trust what you think is best sfackler |
alexcrichton
commented
Jul 11, 2015
Wouldn't it be something along the lines of: fnfmt(&self,f:&mut fmt::Formatter) -> fmt::Result{if f.alternate_flag_enabled(){write!(f,"({:#?},)",self.0)}else{write!(f,"({:?},)",self.0)}} |
sfackler
commented
Jul 11, 2015
That'd generate but the builder would generate |
alexcrichton
commented
Jul 11, 2015
bors
commented
Jul 11, 2015
⌛ Testing commit b0ab164 with merge 0c05219... |
This does change the Debug output for 1-tuples to `(foo)` instead of `(foo,)` but I don't think it's that big of a deal. r? @alexcrichton
This does change the Debug output for 1-tuples to
(foo)instead of(foo,)but I don't think it's that big of a deal.r? @alexcrichton