mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-05 11:33:04 +00:00
WriterPanicked: Use debug_struct
Co-authored-by: Ivan Tham <pickfire@riseup.net>
This commit is contained in:
parent
7fab9cb8ac
commit
5ac431fb08
@ -382,7 +382,9 @@ impl fmt::Display for WriterPanicked {
|
|||||||
#[unstable(feature = "bufwriter_into_raw_parts", issue = "none")]
|
#[unstable(feature = "bufwriter_into_raw_parts", issue = "none")]
|
||||||
impl fmt::Debug for WriterPanicked {
|
impl fmt::Debug for WriterPanicked {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "WriterPanicked{{..buf.len={}..}}", self.buf.len())
|
fmt.debug_struct("WriterPanicked")
|
||||||
|
.field("buffer", &format_args!("{}/{}", self.buf.len(), self.buf.capacity()))
|
||||||
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user