From 9f6a750f9f63811a7e831178448255e9d71b27f5 Mon Sep 17 00:00:00 2001 From: David Kellum Date: Wed, 2 Dec 2020 11:37:32 -0800 Subject: [PATCH] fix remove_entry by moving remove_found after remove_all_extra_values --- src/header/map.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/header/map.rs b/src/header/map.rs index ad6b66cd..31694cae 100644 --- a/src/header/map.rs +++ b/src/header/map.rs @@ -2922,12 +2922,12 @@ impl<'a, T> OccupiedEntry<'a, T> { /// assert!(!map.contains_key("host")); /// ``` pub fn remove_entry(self) -> (HeaderName, T) { - let entry = self.map.remove_found(self.probe, self.index); - - if let Some(links) = entry.links { + if let Some(links) = self.map.entries[self.index].links { self.map.remove_all_extra_values(links.next); } + let entry = self.map.remove_found(self.probe, self.index); + (entry.key, entry.value) }