move drop to impl Drop

This commit is contained in:
Danil Platonov
2026-01-26 04:57:28 -08:00
parent 26523139a8
commit 337d9c5583

View File

@@ -330,10 +330,7 @@ impl Write for HttpWriteStream {
}
#[cfg(feature = "http")]
impl HttpWriteStream {
// TODO why is this suddenly dead code and should it be used somewhere?
// Should this be impl Drop for HttpWriteStream?
#[allow(dead_code)]
impl Drop for HttpWriteStream {
fn drop(&mut self) {
let headers = unsafe { std::mem::ManuallyDrop::take(&mut self.headers) };
let buffer = unsafe { std::mem::ManuallyDrop::take(&mut self.buffer) };
@@ -1537,7 +1534,6 @@ impl Stream {
}
#[cfg(feature = "http")]
Stream::HttpWrite(mut http_stream) => {
http_stream.inner_mut().drop();
http_stream.drop_payload();
Ok(())