@@ -658,7 +658,7 @@ impl<T> HeaderMap<T> {
658658 /// # map.insert(HOST, "bar".parse().unwrap());
659659 /// ```
660660 pub fn reserve ( & mut self , additional : usize ) {
661- self . try_reserve ( additional) . expect ( "reservation failed " )
661+ self . try_reserve ( additional) . expect ( "size overflows MAX_SIZE " )
662662 }
663663
664664 /// Reserves capacity for at least `additional` more headers to be inserted
@@ -1110,7 +1110,7 @@ impl<T> HeaderMap<T> {
11101110 where
11111111 K : IntoHeaderName ,
11121112 {
1113- key. try_entry ( self ) . expect ( "reservation error " )
1113+ key. try_entry ( self ) . expect ( "size overflows MAX_SIZE " )
11141114 }
11151115
11161116 /// Gets the given key's corresponding entry in the map for in-place
@@ -1204,7 +1204,7 @@ impl<T> HeaderMap<T> {
12041204 where
12051205 K : IntoHeaderName ,
12061206 {
1207- self . try_insert ( key, val) . expect ( "reservation failed " )
1207+ self . try_insert ( key, val) . expect ( "size overflows MAX_SIZE " )
12081208 }
12091209
12101210 /// Inserts a key-value pair into the map.
@@ -1345,7 +1345,7 @@ impl<T> HeaderMap<T> {
13451345 where
13461346 K : IntoHeaderName ,
13471347 {
1348- self . try_append ( key, value) . expect ( "reservation error " )
1348+ self . try_append ( key, value) . expect ( "size overflows MAX_SIZE " )
13491349 }
13501350
13511351 /// Inserts a key-value pair into the map.
@@ -2104,10 +2104,10 @@ impl<T> Extend<(HeaderName, T)> for HeaderMap<T> {
21042104 ( iter. size_hint ( ) . 0 + 1 ) / 2
21052105 } ;
21062106
2107- self . try_reserve ( reserve) . expect ( "reservation error " ) ;
2107+ self . try_reserve ( reserve) . expect ( "size overflows MAX_SIZE " ) ;
21082108
21092109 for ( k, v) in iter {
2110- self . try_append ( k, v) . expect ( "reservation error " ) ;
2110+ self . try_append ( k, v) . expect ( "size overflows MAX_SIZE " ) ;
21112111 }
21122112 }
21132113}
@@ -2445,7 +2445,7 @@ impl<'a, T> Entry<'a, T> {
24452445 /// assert_eq!(map["x-hello"], 1);
24462446 /// ```
24472447 pub fn or_insert ( self , default : T ) -> & ' a mut T {
2448- self . or_try_insert ( default) . expect ( "capacity error " )
2448+ self . or_try_insert ( default) . expect ( "size overflows MAX_SIZE " )
24492449 }
24502450
24512451 /// Ensures a value is in the entry by inserting the default if empty.
@@ -2522,7 +2522,7 @@ impl<'a, T> Entry<'a, T> {
25222522 /// assert_eq!(res, "world");
25232523 /// ```
25242524 pub fn or_insert_with < F : FnOnce ( ) -> T > ( self , default : F ) -> & ' a mut T {
2525- self . or_try_insert_with ( default) . expect ( "reservation error " )
2525+ self . or_try_insert_with ( default) . expect ( "size overflows MAX_SIZE " )
25262526 }
25272527
25282528 /// Ensures a value is in the entry by inserting the result of the default
@@ -2641,7 +2641,7 @@ impl<'a, T> VacantEntry<'a, T> {
26412641 /// assert_eq!(map["x-hello"], "world");
26422642 /// ```
26432643 pub fn insert ( self , value : T ) -> & ' a mut T {
2644- self . try_insert ( value) . expect ( "reservation failed " )
2644+ self . try_insert ( value) . expect ( "size overflows MAX_SIZE " )
26452645 }
26462646
26472647 /// Insert the value into the entry.
@@ -2689,7 +2689,7 @@ impl<'a, T> VacantEntry<'a, T> {
26892689 /// assert_eq!(map["x-hello"], "world2");
26902690 /// ```
26912691 pub fn insert_entry ( self , value : T ) -> OccupiedEntry < ' a , T > {
2692- self . try_insert_entry ( value) . expect ( "reserve failed " )
2692+ self . try_insert_entry ( value) . expect ( "size overflows MAX_SIZE " )
26932693 }
26942694
26952695 /// Insert the value into the entry.
0 commit comments