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