Auto merge of #31068 - sfackler:bufwriter-panic, r=alexcrichton
Auto merge of #31068 - sfackler:bufwriter-panic, r=alexcrichton

We don't want to write the same data twice.

Closes #30888

r? @alexcrichton

aidancully/rust,aidancully/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust