File tree Expand file tree Collapse file tree 3 files changed +108
-105
lines changed Expand file tree Collapse file tree 3 files changed +108
-105
lines changed Original file line number Diff line number Diff line change @@ -2059,7 +2059,7 @@ impl<T> Extend<(Option<HeaderName>, T)> for HeaderMap<T> {
20592059 } ;
20602060
20612061 ' outer: loop {
2062- let mut entry = match self . entry2 ( key) {
2062+ let mut entry = match self . try_entry2 ( key) . expect ( "size overflows MAX_SIZE" ) {
20632063 Entry :: Occupied ( mut e) => {
20642064 // Replace all previous values while maintaining a handle to
20652065 // the entry.
Original file line number Diff line number Diff line change @@ -488,8 +488,8 @@ mod from_header_name_tests {
488488 #[ test]
489489 fn it_can_insert_header_name_as_header_value ( ) {
490490 let mut map = HeaderMap :: new ( ) ;
491- map. try_insert ( name:: UPGRADE , name:: SEC_WEBSOCKET_PROTOCOL . into ( ) ) . unwrap ( ) ;
492- map. try_insert (
491+ map. insert ( name:: UPGRADE , name:: SEC_WEBSOCKET_PROTOCOL . into ( ) ) ;
492+ map. insert (
493493 name:: ACCEPT ,
494494 name:: HeaderName :: from_bytes ( b"hello-world" ) . unwrap ( ) . into ( ) ,
495495 ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments