You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This explanation might be redundant, but I see two separate issues:
A named tuple with no elements prints Name rather than Name(). Admittedly, the latter doesn't currently exist in Rust, but it might be added later like struct Name {} was, and the former Name isn't a tuple struct at all. This might be considered an actual bug.
An un-named tuple with 0 or 1 elements prints nothing or (elem) (with no trailing comma), respectively. This is basically a feature request to make debug_tuple work for anonymous tuples.
DebugTuple
should have options controlling how to output tuples with 0 and 1 element.Currently if 0 fields are provided, only the name passed into
debug_tuple
is printed. Would be nice if there was option to print{name}()
.Currently if only 1 field is provided, trailing comma is not printed. There should be an option to add one:
(value,)
.These could be added as option setters on the
DebugTuple
builder. E.g.fn empty_tuple(bool)
andfn trailing_comma(bool)
.That would make
debug_tuple
actually usable to print tuples.The text was updated successfully, but these errors were encountered: