mirror of
https://github.com/openharmony/third_party_rust_http.git
synced 2026-07-19 14:43:33 -04:00
Document panic on header index (#223)
This commit is contained in:
committed by
Carl Lerche
parent
18c96f0542
commit
c1b260d90f
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user