Skip to content

Commit bb4f913

Browse files
committed
Merge pull request #268 from hyperium/ufcs
refactor(headers): remove marker from header_name method
2 parents 65ed029 + 8215889 commit bb4f913

31 files changed

+38
-38
lines changed

benches/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn handle(_r: Request, res: Response) {
3434
struct Foo;
3535

3636
impl hyper::header::Header for Foo {
37-
fn header_name(_: Option<Foo>) -> &'static str {
37+
fn header_name() -> &'static str {
3838
"x-foo"
3939
}
4040
fn parse_header(_: &[Vec<u8>]) -> Option<Foo> {

benches/client_mock_tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl Writer for MockStream {
5050
struct Foo;
5151

5252
impl hyper::header::Header for Foo {
53-
fn header_name(_: Option<Foo>) -> &'static str {
53+
fn header_name() -> &'static str {
5454
"x-foo"
5555
}
5656
fn parse_header(_: &[Vec<u8>]) -> Option<Foo> {

src/header/common/accept.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct Accept(pub Vec<header::QualityItem<mime::Mime>>);
3131
deref!(Accept => Vec<header::QualityItem<mime::Mime>>);
3232

3333
impl header::Header for Accept {
34-
fn header_name(_: Option<Accept>) -> &'static str {
34+
fn header_name() -> &'static str {
3535
"Accept"
3636
}
3737

src/header/common/access_control/allow_headers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct AccessControlAllowHeaders(pub Vec<String>);
1515

1616
impl header::Header for AccessControlAllowHeaders {
1717
#[inline]
18-
fn header_name(_: Option<AccessControlAllowHeaders>) -> &'static str {
18+
fn header_name() -> &'static str {
1919
"Access-Control-Allow-Headers"
2020
}
2121

src/header/common/access_control/allow_methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct AccessControlAllowMethods(pub Vec<method::Method>);
1616

1717
impl header::Header for AccessControlAllowMethods {
1818
#[inline]
19-
fn header_name(_: Option<AccessControlAllowMethods>) -> &'static str {
19+
fn header_name() -> &'static str {
2020
"Access-Control-Allow-Methods"
2121
}
2222

src/header/common/access_control/allow_origin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub enum AccessControlAllowOrigin {
2323

2424
impl header::Header for AccessControlAllowOrigin {
2525
#[inline]
26-
fn header_name(_: Option<AccessControlAllowOrigin>) -> &'static str {
26+
fn header_name() -> &'static str {
2727
"Access-Control-Allow-Origin"
2828
}
2929

src/header/common/access_control/max_age.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct AccessControlMaxAge(pub u32);
1414

1515
impl header::Header for AccessControlMaxAge {
1616
#[inline]
17-
fn header_name(_: Option<AccessControlMaxAge>) -> &'static str {
17+
fn header_name() -> &'static str {
1818
"Access-Control-Max-Age"
1919
}
2020

src/header/common/access_control/request_headers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct AccessControlRequestHeaders(pub Vec<String>);
1414

1515
impl header::Header for AccessControlRequestHeaders {
1616
#[inline]
17-
fn header_name(_: Option<AccessControlRequestHeaders>) -> &'static str {
17+
fn header_name() -> &'static str {
1818
"Access-Control-Request-Headers"
1919
}
2020

src/header/common/access_control/request_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct AccessControlRequestMethod(pub Method);
1515

1616
impl header::Header for AccessControlRequestMethod {
1717
#[inline]
18-
fn header_name(_: Option<AccessControlRequestMethod>) -> &'static str {
18+
fn header_name() -> &'static str {
1919
"Access-Control-Request-Method"
2020
}
2121

src/header/common/allow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Allow(pub Vec<Method>);
1212
deref!(Allow => Vec<Method>);
1313

1414
impl Header for Allow {
15-
fn header_name(_: Option<Allow>) -> &'static str {
15+
fn header_name() -> &'static str {
1616
"Allow"
1717
}
1818

0 commit comments

Comments
 (0)