Skip to content

Commit 6b859a8

Browse files
committed
checkpoint
1 parent 01a6267 commit 6b859a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+178
-1588
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/Cargo.lock

src/common/accept.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ header! {
7878
/// ])
7979
/// );
8080
/// ```
81-
(Accept, "Accept") => (QualityItem<Mime>)+
81+
(Accept, ACCEPT) => (QualityItem<Mime>)+
8282

8383
test_accept {
8484
// Tests from the RFC

src/common/accept_charset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ header! {
4848
/// AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
4949
/// );
5050
/// ```
51-
(AcceptCharset, "Accept-Charset") => (QualityItem<Charset>)+
51+
(AcceptCharset, ACCEPT_CHARSET) => (QualityItem<Charset>)+
5252

5353
test_accept_charset {
5454
/// Testcase from RFC

src/common/accept_encoding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ header! {
5757
/// ])
5858
/// );
5959
/// ```
60-
(AcceptEncoding, "Accept-Encoding") => (QualityItem<Encoding>)*
60+
(AcceptEncoding, ACCEPT_ENCODING) => (QualityItem<Encoding>)*
6161

6262
test_accept_encoding {
6363
// From the RFC

src/common/accept_language.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ header! {
5252
/// );
5353
/// # }
5454
/// ```
55-
(AcceptLanguage, "Accept-Language") => (QualityItem<LanguageTag>)+
55+
(AcceptLanguage, ACCEPT_LANGUAGE) => (QualityItem<LanguageTag>)+
5656

5757
test_accept_language {
5858
// From the RFC

src/common/accept_ranges.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ header! {
4848
/// ])
4949
/// );
5050
/// ```
51-
(AcceptRanges, "Accept-Ranges") => (RangeUnit)+
51+
(AcceptRanges, ACCEPT_RANGES) => (RangeUnit)+
5252

5353
test_acccept_ranges {
5454
test_header!(test1, vec![b"bytes"]);

src/common/access_control_allow_headers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ header! {
5353
/// );
5454
/// # }
5555
/// ```
56-
(AccessControlAllowHeaders, "Access-Control-Allow-Headers") => (Ascii<String>)*
56+
(AccessControlAllowHeaders, ACCESS_CONTROL_ALLOW_HEADERS) => (Ascii<String>)*
5757

5858
test_access_control_allow_headers {
5959
test_header!(test1, vec![b"accept-language, date"]);

src/common/access_control_allow_methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ header! {
4848
/// ])
4949
/// );
5050
/// ```
51-
(AccessControlAllowMethods, "Access-Control-Allow-Methods") => (Method)*
51+
(AccessControlAllowMethods, ACCESS_CONTROL_ALLOW_METHODS) => (Method)*
5252

5353
test_access_control_allow_methods {
5454
test_header!(test1, vec![b"PUT, DELETE, XMODIFY"]);

src/common/access_control_expose_headers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ header! {
5555
/// );
5656
/// # }
5757
/// ```
58-
(AccessControlExposeHeaders, "Access-Control-Expose-Headers") => (Ascii<String>)*
58+
(AccessControlExposeHeaders, ACCESS_CONTROL_EXPOSE_HEADERS) => (Ascii<String>)*
5959

6060
test_access_control_expose_headers {
6161
test_header!(test1, vec![b"etag, content-length"]);

src/common/access_control_max_age.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ header! {
2323
/// let mut headers = Headers::new();
2424
/// headers.set(AccessControlMaxAge(1728000u32));
2525
/// ```
26-
(AccessControlMaxAge, "Access-Control-Max-Age") => [u32]
26+
(AccessControlMaxAge, ACCESS_CONTROL_MAX_AGE) => [u32]
2727

2828
test_access_control_max_age {
2929
test_header!(test1, vec![b"531"]);

src/common/access_control_request_headers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ header! {
5353
/// );
5454
/// # }
5555
/// ```
56-
(AccessControlRequestHeaders, "Access-Control-Request-Headers") => (Ascii<String>)*
56+
(AccessControlRequestHeaders, ACCESS_CONTROL_REQUEST_HEADERS) => (Ascii<String>)*
5757

5858
test_access_control_request_headers {
5959
test_header!(test1, vec![b"accept-language, date"]);

src/common/access_control_request_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ header! {
2626
/// let mut headers = Headers::new();
2727
/// headers.set(AccessControlRequestMethod(Method::GET));
2828
/// ```
29-
(AccessControlRequestMethod, "Access-Control-Request-Method") => [Method]
29+
(AccessControlRequestMethod, ACCESS_CONTROL_REQUEST_METHOD) => [Method]
3030

3131
test_access_control_request_method {
3232
test_header!(test1, vec![b"GET"]);

src/common/allow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ header! {
5050
/// ])
5151
/// );
5252
/// ```
53-
(Allow, "Allow") => (Method)*
53+
(Allow, ALLOW) => (Method)*
5454

5555
test_allow {
5656
// From the RFC

src/common/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ header! {
9696
/// );
9797
/// # }
9898
/// ```
99-
(Connection, "Connection") => (ConnectionOption)+
99+
(Connection, CONNECTION) => (ConnectionOption)+
100100

101101
test_connection {
102102
test_header!(test1, vec![b"close"]);

src/common/content_encoding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ header! {
4242
/// ])
4343
/// );
4444
/// ```
45-
(ContentEncoding, "Content-Encoding") => (Encoding)+
45+
(ContentEncoding, CONTENT_ENCODING) => (Encoding)+
4646

4747
test_content_encoding {
4848
/// Testcase from the RFC

src/common/content_language.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ header! {
5454
/// );
5555
/// # }
5656
/// ```
57-
(ContentLanguage, "Content-Language") => (QualityItem<LanguageTag>)+
57+
(ContentLanguage, CONTENT_LANGUAGE) => (QualityItem<LanguageTag>)+
5858

5959
test_content_language {
6060
test_header!(test1, vec![b"da"]);

src/common/content_location.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ header! {
3737
/// headers.set(ContentLocation("http://www.example.org/hypertext/Overview.html".to_owned()));
3838
/// ```
3939
// TODO: use URL
40-
(ContentLocation, "Content-Location") => [String]
40+
(ContentLocation, CONTENT_LOCATION) => [String]
4141

4242
test_content_location {
4343
test_header!(partial_query, vec![b"/hypertext/Overview.html?q=tim"]);

src/common/content_range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::str::FromStr;
44
header! {
55
/// `Content-Range` header, defined in
66
/// [RFC7233](http://tools.ietf.org/html/rfc7233#section-4.2)
7-
(ContentRange, "Content-Range") => [ContentRangeSpec]
7+
(ContentRange, CONTENT_RANGE) => [ContentRangeSpec]
88

99
test_content_range {
1010
test_header!(test_bytes,

src/common/content_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ header! {
5151
/// ContentType(mime::TEXT_HTML)
5252
/// );
5353
/// ```
54-
(ContentType, "Content-Type") => danger [Mime]
54+
(ContentType, CONTENT_TYPE) => [Mime]
5555

5656
test_content_type {
5757
test_header!(

src/common/date.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ header! {
2525
/// let mut headers = Headers::new();
2626
/// headers.set(Date(SystemTime::now().into()));
2727
/// ```
28-
(Date, "Date") => [HttpDate]
28+
(Date, DATE) => [HttpDate]
2929

3030
test_date {
3131
test_header!(test1, vec![b"Tue, 15 Nov 1994 08:12:31 GMT"]);

src/common/etag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ header! {
3939
/// let mut headers = Headers::new();
4040
/// headers.set(ETag(EntityTag::new(true, "xyzzy".to_owned())));
4141
/// ```
42-
(ETag, "ETag") => [EntityTag]
42+
(ETag, ETAG) => [EntityTag]
4343

4444
test_etag {
4545
// From the RFC

src/common/expires.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ header! {
2929
/// let expiration = SystemTime::now() + Duration::from_secs(60 * 60 * 24);
3030
/// headers.set(Expires(expiration.into()));
3131
/// ```
32-
(Expires, "Expires") => [HttpDate]
32+
(Expires, EXPIRES) => [HttpDate]
3333

3434
test_expires {
3535
// Testcase from RFC

src/common/from.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ header! {
2121
/// headers.set(From("[email protected]".to_owned()));
2222
/// ```
2323
// FIXME: Maybe use mailbox?
24-
(From, "From") => [String]
24+
(From, FROM) => [String]
2525

2626
test_from {
2727
test_header!(test1, vec![b"[email protected]"]);

src/common/if_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ header! {
4848
/// ])
4949
/// );
5050
/// ```
51-
(IfMatch, "If-Match") => {Any / (EntityTag)+}
51+
(IfMatch, IF_MATCH) => {Any / (EntityTag)+}
5252

5353
test_if_match {
5454
test_header!(

src/common/if_modified_since.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ header! {
2929
/// let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
3030
/// headers.set(IfModifiedSince(modified.into()));
3131
/// ```
32-
(IfModifiedSince, "If-Modified-Since") => [HttpDate]
32+
(IfModifiedSince, IF_MODIFIED_SINCE) => [HttpDate]
3333

3434
test_if_modified_since {
3535
// Testcase from RFC

src/common/if_none_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ header! {
5050
/// ])
5151
/// );
5252
/// ```
53-
(IfNoneMatch, "If-None-Match") => {Any / (EntityTag)+}
53+
(IfNoneMatch, IF_NONE_MATCH) => {Any / (EntityTag)+}
5454

5555
test_if_none_match {
5656
test_header!(test1, vec![b"\"xyzzy\""]);

src/common/if_unmodified_since.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ header! {
3030
/// let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
3131
/// headers.set(IfUnmodifiedSince(modified.into()));
3232
/// ```
33-
(IfUnmodifiedSince, "If-Unmodified-Since") => [HttpDate]
33+
(IfUnmodifiedSince, IF_UNMODIFIED_SINCE) => [HttpDate]
3434

3535
test_if_unmodified_since {
3636
// Testcase from RFC

src/common/last_modified.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ header! {
2929
/// let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
3030
/// headers.set(LastModified(modified.into()));
3131
/// ```
32-
(LastModified, "Last-Modified") => [HttpDate]
32+
(LastModified, LAST_MODIFIED) => [HttpDate]
3333

3434
test_last_modified {
3535
// Testcase from RFC

src/common/location.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ header! {
3333
/// headers.set(Location::new("http://www.example.com/index.html"));
3434
/// ```
3535
// TODO: Use URL
36-
(Location, "Location") => Cow[str]
36+
(Location, LOCATION) => Cow[str]
3737

3838
test_location {
3939
// Testcase from RFC

0 commit comments

Comments
 (0)