revert change of ResponseHead

This commit is contained in:
fakeshadow 2021-01-18 09:58:37 +08:00
parent 0819cfbe7b
commit e5cf2abf0a
1 changed files with 3 additions and 7 deletions

View File

@ -414,13 +414,9 @@ impl std::ops::DerefMut for BoxedResponseHead {
impl Drop for BoxedResponseHead {
fn drop(&mut self) {
RESPONSE_POOL.with(move |p| {
p.release(
self.head
.take()
.expect("ResponseHead is taken before dropped"),
)
})
if let Some(head) = self.head.take() {
RESPONSE_POOL.with(move |p| p.release(head))
}
}
}