-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update debug helpers and use it for stdlib collections #23810
Conversation
r? @aturon |
(rust_highfive has picked a reviewer for you, use r? to override) |
The collections debug helpers no longer prefix output with the collection name, in line with the current conventions for Debug implementations. Implementations that want to preserve the current behavior can simply add a `try!(write!(fmt, "TypeName "));` at the beginning of the `fmt` method. [breaking-change]
cb97126
to
4037f2a
Compare
} | ||
|
||
write!(f, "}}") | ||
builder.finish() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may actually be a prime spot for a fold
:
self.iter().fold(f.debug_map(), |b, (k, v)| b.entry(k, v)).finish()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh nice!
r=me with some |
By the way, |
Yeah that sounds good to me |
Also convert [T]'s Debug impl. The behavior of the alternate flag here's changing.
@bors r=alexcrichton 14926ca |
⌛ Testing commit 14926ca with merge b37e37e... |
💔 Test failed - auto-mac-64-opt |
14926ca
to
842e6cf
Compare
@bors r=alexcrichton 10feb40 |
⌛ Testing commit 10feb40 with merge c67e4b4... |
💔 Test failed - auto-mac-64-opt |
10feb40
to
3c0c8fc
Compare
The collections debug helpers no longer prefix output with the collection name, in line with the current conventions for Debug implementations. Implementations that want to preserve the current behavior can simply add a `try!(write!(fmt, "TypeName "));` at the beginning of the `fmt` method. [breaking-change]
The collections debug helpers no longer prefix output with the
collection name, in line with the current conventions for Debug
implementations. Implementations that want to preserve the current
behavior can simply add a
try!(write!(fmt, "TypeName "));
at thebeginning of the
fmt
method.[breaking-change]