Skip to content

Commit

Permalink
fix remove_entry by moving remove_found after remove_all_extra_values
Browse files Browse the repository at this point in the history
  • Loading branch information
dekellum committed Dec 2, 2020
1 parent e419939 commit 9f6a750
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/header/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 9f6a750

Please sign in to comment.