mirror of
https://github.com/fafhrd91/actix-web
synced 2025-09-02 01:31:57 +02:00
align remaining header map terminology (#2510)
This commit is contained in:
@@ -14,7 +14,7 @@ use once_cell::sync::Lazy;
|
||||
use regex::Regex;
|
||||
use std::fmt::{self, Write};
|
||||
|
||||
use super::{ExtendedValue, Header, IntoHeaderValue, Writer};
|
||||
use super::{ExtendedValue, Header, TryIntoHeaderValue, Writer};
|
||||
use crate::http::header;
|
||||
|
||||
/// Split at the index of the first `needle` if it exists or at the end.
|
||||
@@ -454,7 +454,7 @@ impl ContentDisposition {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoHeaderValue for ContentDisposition {
|
||||
impl TryIntoHeaderValue for ContentDisposition {
|
||||
type Error = header::InvalidHeaderValue;
|
||||
|
||||
fn try_into_value(self) -> Result<header::HeaderValue, Self::Error> {
|
||||
|
@@ -3,7 +3,7 @@ use std::{
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
use super::{HeaderValue, IntoHeaderValue, InvalidHeaderValue, Writer, CONTENT_RANGE};
|
||||
use super::{HeaderValue, InvalidHeaderValue, TryIntoHeaderValue, Writer, CONTENT_RANGE};
|
||||
use crate::error::ParseError;
|
||||
|
||||
crate::http::header::common_header! {
|
||||
@@ -196,7 +196,7 @@ impl Display for ContentRangeSpec {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoHeaderValue for ContentRangeSpec {
|
||||
impl TryIntoHeaderValue for ContentRangeSpec {
|
||||
type Error = InvalidHeaderValue;
|
||||
|
||||
fn try_into_value(self) -> Result<HeaderValue, Self::Error> {
|
||||
|
@@ -3,7 +3,7 @@ use std::{
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
use super::{HeaderValue, IntoHeaderValue, InvalidHeaderValue, Writer};
|
||||
use super::{HeaderValue, InvalidHeaderValue, TryIntoHeaderValue, Writer};
|
||||
|
||||
/// check that each char in the slice is either:
|
||||
/// 1. `%x21`, or
|
||||
@@ -159,7 +159,7 @@ impl FromStr for EntityTag {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoHeaderValue for EntityTag {
|
||||
impl TryIntoHeaderValue for EntityTag {
|
||||
type Error = InvalidHeaderValue;
|
||||
|
||||
fn try_into_value(self) -> Result<HeaderValue, Self::Error> {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use std::fmt::{self, Display, Write};
|
||||
|
||||
use super::{
|
||||
from_one_raw_str, EntityTag, Header, HeaderName, HeaderValue, HttpDate, IntoHeaderValue,
|
||||
InvalidHeaderValue, Writer,
|
||||
from_one_raw_str, EntityTag, Header, HeaderName, HeaderValue, HttpDate, InvalidHeaderValue,
|
||||
TryIntoHeaderValue, Writer,
|
||||
};
|
||||
use crate::error::ParseError;
|
||||
use crate::http::header;
|
||||
@@ -96,7 +96,7 @@ impl Display for IfRange {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoHeaderValue for IfRange {
|
||||
impl TryIntoHeaderValue for IfRange {
|
||||
type Error = InvalidHeaderValue;
|
||||
|
||||
fn try_into_value(self) -> Result<HeaderValue, Self::Error> {
|
||||
|
@@ -125,7 +125,7 @@ macro_rules! common_header {
|
||||
}
|
||||
}
|
||||
|
||||
impl $crate::http::header::IntoHeaderValue for $id {
|
||||
impl $crate::http::header::TryIntoHeaderValue for $id {
|
||||
type Error = $crate::http::header::InvalidHeaderValue;
|
||||
|
||||
#[inline]
|
||||
@@ -172,7 +172,7 @@ macro_rules! common_header {
|
||||
}
|
||||
}
|
||||
|
||||
impl $crate::http::header::IntoHeaderValue for $id {
|
||||
impl $crate::http::header::TryIntoHeaderValue for $id {
|
||||
type Error = $crate::http::header::InvalidHeaderValue;
|
||||
|
||||
#[inline]
|
||||
@@ -211,7 +211,7 @@ macro_rules! common_header {
|
||||
}
|
||||
}
|
||||
|
||||
impl $crate::http::header::IntoHeaderValue for $id {
|
||||
impl $crate::http::header::TryIntoHeaderValue for $id {
|
||||
type Error = $crate::http::header::InvalidHeaderValue;
|
||||
|
||||
#[inline]
|
||||
@@ -266,7 +266,7 @@ macro_rules! common_header {
|
||||
}
|
||||
}
|
||||
|
||||
impl $crate::http::header::IntoHeaderValue for $id {
|
||||
impl $crate::http::header::TryIntoHeaderValue for $id {
|
||||
type Error = $crate::http::header::InvalidHeaderValue;
|
||||
|
||||
#[inline]
|
||||
|
@@ -6,7 +6,7 @@ use std::{
|
||||
|
||||
use actix_http::{error::ParseError, header, HttpMessage};
|
||||
|
||||
use super::{Header, HeaderName, HeaderValue, IntoHeaderValue, InvalidHeaderValue, Writer};
|
||||
use super::{Header, HeaderName, HeaderValue, InvalidHeaderValue, TryIntoHeaderValue, Writer};
|
||||
|
||||
/// `Range` header, defined
|
||||
/// in [RFC 7233 §3.1](https://datatracker.ietf.org/doc/html/rfc7233#section-3.1)
|
||||
@@ -274,7 +274,7 @@ impl Header for Range {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoHeaderValue for Range {
|
||||
impl TryIntoHeaderValue for Range {
|
||||
type Error = InvalidHeaderValue;
|
||||
|
||||
fn try_into_value(self) -> Result<HeaderValue, Self::Error> {
|
||||
|
Reference in New Issue
Block a user