From c1b260d90f7016426511cb2f7db747bb00cf67eb Mon Sep 17 00:00:00 2001 From: Bertrand Bousquet Date: Tue, 3 Jul 2018 12:31:06 -0400 Subject: [PATCH] Document panic on header index (#223) --- src/header/map.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/header/map.rs b/src/header/map.rs index 93a2c62..09f1614 100644 --- a/src/header/map.rs +++ b/src/header/map.rs @@ -1864,6 +1864,8 @@ impl<'a, K, T> ops::Index for HeaderMap { type Output = T; + /// # Panics + /// Using the index operator will cause a panic if the header you're querying isn't set. #[inline] fn index(&self, index: K) -> &T { self.get(index).expect("no entry found for key")