refactor(headers): remove marker from header_name method
It is no longer required, as we can use `<H as Header>::header_name()`.
BREAKING CHANGE: Implementations of Header will need to adjust the
header_name method. It no longer takes any arguments.
This commit is contained in:
@@ -15,7 +15,7 @@ pub struct AccessControlAllowHeaders(pub Vec<String>);
|
||||
|
||||
impl header::Header for AccessControlAllowHeaders {
|
||||
#[inline]
|
||||
fn header_name(_: Option<AccessControlAllowHeaders>) -> &'static str {
|
||||
fn header_name() -> &'static str {
|
||||
"Access-Control-Allow-Headers"
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ pub struct AccessControlAllowMethods(pub Vec<method::Method>);
|
||||
|
||||
impl header::Header for AccessControlAllowMethods {
|
||||
#[inline]
|
||||
fn header_name(_: Option<AccessControlAllowMethods>) -> &'static str {
|
||||
fn header_name() -> &'static str {
|
||||
"Access-Control-Allow-Methods"
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ pub enum AccessControlAllowOrigin {
|
||||
|
||||
impl header::Header for AccessControlAllowOrigin {
|
||||
#[inline]
|
||||
fn header_name(_: Option<AccessControlAllowOrigin>) -> &'static str {
|
||||
fn header_name() -> &'static str {
|
||||
"Access-Control-Allow-Origin"
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct AccessControlMaxAge(pub u32);
|
||||
|
||||
impl header::Header for AccessControlMaxAge {
|
||||
#[inline]
|
||||
fn header_name(_: Option<AccessControlMaxAge>) -> &'static str {
|
||||
fn header_name() -> &'static str {
|
||||
"Access-Control-Max-Age"
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct AccessControlRequestHeaders(pub Vec<String>);
|
||||
|
||||
impl header::Header for AccessControlRequestHeaders {
|
||||
#[inline]
|
||||
fn header_name(_: Option<AccessControlRequestHeaders>) -> &'static str {
|
||||
fn header_name() -> &'static str {
|
||||
"Access-Control-Request-Headers"
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct AccessControlRequestMethod(pub Method);
|
||||
|
||||
impl header::Header for AccessControlRequestMethod {
|
||||
#[inline]
|
||||
fn header_name(_: Option<AccessControlRequestMethod>) -> &'static str {
|
||||
fn header_name() -> &'static str {
|
||||
"Access-Control-Request-Method"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user