Document panic on header index (#223)

This commit is contained in:
Bertrand Bousquet
2018-07-03 12:31:06 -04:00
committed by Carl Lerche
parent 18c96f0542
commit c1b260d90f
+2
View File
@@ -1864,6 +1864,8 @@ impl<'a, K, T> ops::Index<K> for HeaderMap<T>
{
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")