We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9e988f commit 1587527Copy full SHA for 1587527
stackslib/src/net/http/request.rs
@@ -438,15 +438,13 @@ impl StacksMessageCodec for HttpRequestPreamble {
438
} else if key == "set-cookie" {
439
set_cookie.push(value);
440
} else {
441
- match headers.entry(key) {
442
- Entry::Vacant(vacant_entry) => {
443
- vacant_entry.insert(value);
444
- }
445
- Entry::Occupied(mut occupied_entry) => {
446
- occupied_entry.get_mut().push_str(", ");
447
- occupied_entry.get_mut().push_str(&value);
448
449
+ headers
+ .entry(key)
+ .and_modify(|entry| {
+ entry.push_str(", ");
+ entry.push_str(&value);
+ })
+ .or_insert(value);
450
}
451
452
0 commit comments