mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-19 12:25:37 +02:00
align remaining header map terminology (#2510)
This commit is contained in:
@@ -14,7 +14,7 @@ use bytes::{Bytes, BytesMut};
|
||||
use http::{Method, Uri, Version};
|
||||
|
||||
use crate::{
|
||||
header::{HeaderMap, IntoHeaderPair},
|
||||
header::{HeaderMap, TryIntoHeaderPair},
|
||||
payload::Payload,
|
||||
Request,
|
||||
};
|
||||
@@ -92,11 +92,8 @@ impl TestRequest {
|
||||
}
|
||||
|
||||
/// Insert a header, replacing any that were set with an equivalent field name.
|
||||
pub fn insert_header<H>(&mut self, header: H) -> &mut Self
|
||||
where
|
||||
H: IntoHeaderPair,
|
||||
{
|
||||
match header.try_into_header_pair() {
|
||||
pub fn insert_header(&mut self, header: impl TryIntoHeaderPair) -> &mut Self {
|
||||
match header.try_into_pair() {
|
||||
Ok((key, value)) => {
|
||||
parts(&mut self.0).headers.insert(key, value);
|
||||
}
|
||||
@@ -109,11 +106,8 @@ impl TestRequest {
|
||||
}
|
||||
|
||||
/// Append a header, keeping any that were set with an equivalent field name.
|
||||
pub fn append_header<H>(&mut self, header: H) -> &mut Self
|
||||
where
|
||||
H: IntoHeaderPair,
|
||||
{
|
||||
match header.try_into_header_pair() {
|
||||
pub fn append_header(&mut self, header: impl TryIntoHeaderPair) -> &mut Self {
|
||||
match header.try_into_pair() {
|
||||
Ok((key, value)) => {
|
||||
parts(&mut self.0).headers.append(key, value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user