Refactor to use debug_struct in several Debug impls

Fixes #44771.
This commit is contained in:
Malo Jaffré 2017-10-09 20:09:08 +02:00
parent eabef0608b
commit 679457ad2a
7 changed files with 42 additions and 61 deletions

View file

@ -338,8 +338,11 @@ impl serialize::UseSpecializedDecodable for Span {
}
fn default_span_debug(span: Span, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Span {{ lo: {:?}, hi: {:?}, ctxt: {:?} }}",
span.lo(), span.hi(), span.ctxt())
f.debug_struct("Span")
.field("lo", &span.lo())
.field("hi", &span.hi())
.field("ctxt", &span.ctxt())
.finish()
}
impl fmt::Debug for Span {