Skip to content

Commit a21fd08

Browse files
committed
Update headers_mod! macro
Semicolon after ty is no longer supported. See rust-lang/rust#20563
1 parent b2d6dfc commit a21fd08

File tree

1 file changed

+71
-71
lines changed

1 file changed

+71
-71
lines changed

src/http/headers/mod.rs

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -879,14 +879,14 @@ macro_rules! headers_mod {
879879
// Not using this because of a "local ambiguity" bug
880880
//$($attrs:attr)*
881881
pub mod $mod_name:ident;
882-
num_headers: $num_headers:pat;
882+
num_headers: $num_headers:expr;
883883
$(
884884
$num_id:pat,
885885
$output_name:expr,
886886
$input_name:pat,
887887
$caps_ident:ident,
888888
$lower_ident:ident,
889-
$htype:ty;
889+
$htype:ty,
890890
)*
891891
} => {
892892
pub mod $mod_name {
@@ -1054,48 +1054,48 @@ headers_mod! {
10541054
num_headers: 38;
10551055

10561056
// RFC 2616, Section 4.5: General Header Fields
1057-
0, "Cache-Control", "cache-control", CacheControl, cache_control, String;
1058-
1, "Connection", "connection", Connection, connection, Vec<headers::connection::Connection>;
1059-
2, "Date", "date", Date, date, time::Tm;
1060-
3, "Pragma", "pragma", Pragma, pragma, String;
1061-
4, "Trailer", "trailer", Trailer, trailer, String;
1062-
5, "Transfer-Encoding", "transfer-encoding", TransferEncoding, transfer_encoding, Vec<headers::transfer_encoding::TransferCoding>;
1063-
6, "Upgrade", "upgrade", Upgrade, upgrade, String;
1064-
7, "Via", "via", Via, via, String;
1065-
8, "Warning", "warning", Warning, warning, String;
1057+
0, "Cache-Control", "cache-control", CacheControl, cache_control, String,
1058+
1, "Connection", "connection", Connection, connection, Vec<headers::connection::Connection>,
1059+
2, "Date", "date", Date, date, time::Tm,
1060+
3, "Pragma", "pragma", Pragma, pragma, String,
1061+
4, "Trailer", "trailer", Trailer, trailer, String,
1062+
5, "Transfer-Encoding", "transfer-encoding", TransferEncoding, transfer_encoding, Vec<headers::transfer_encoding::TransferCoding>,
1063+
6, "Upgrade", "upgrade", Upgrade, upgrade, String,
1064+
7, "Via", "via", Via, via, String,
1065+
8, "Warning", "warning", Warning, warning, String,
10661066

10671067
// RFC 2616, Section 5.3: Request Header Fields
1068-
9, "Accept", "accept", Accept, accept, String;
1069-
10, "Accept-Charset", "accept-charset", AcceptCharset, accept_charset, String;
1070-
11, "Accept-Encoding", "accept-encoding", AcceptEncoding, accept_encoding, String;
1071-
12, "Accept-Language", "accept-language", AcceptLanguage, accept_language, String;
1072-
13, "Authorization", "authorization", Authorization, authorization, String;
1073-
14, "Expect", "expect", Expect, expect, String;
1074-
15, "From", "from", From, from, String;
1075-
16, "Host", "host", Host, host, headers::host::Host;
1076-
17, "If-Match", "if-match", IfMatch, if_match, String;
1077-
18, "If-Modified-Since", "if-modified-since", IfModifiedSince, if_modified_since, time::Tm;
1078-
19, "If-None-Match", "if-none-match", IfNoneMatch, if_none_match, String;
1079-
20, "If-Range", "if-range", IfRange, if_range, String;
1080-
21, "If-Unmodified-Since", "if-unmodified-since", IfUnmodifiedSince, if_unmodified_since, time::Tm;
1081-
22, "Max-Forwards", "max-forwards", MaxForwards, max_forwards, uint;
1082-
23, "Proxy-Authorization", "proxy-authorization", ProxyAuthorization, proxy_authorization, String;
1083-
24, "Range", "range", Range, range, String;
1084-
25, "Referer", "referer", Referer, referer, String;
1085-
26, "TE", "te", Te, te, String;
1086-
27, "User-Agent", "user-agent", UserAgent, user_agent, String;
1068+
9, "Accept", "accept", Accept, accept, String,
1069+
10, "Accept-Charset", "accept-charset", AcceptCharset, accept_charset, String,
1070+
11, "Accept-Encoding", "accept-encoding", AcceptEncoding, accept_encoding, String,
1071+
12, "Accept-Language", "accept-language", AcceptLanguage, accept_language, String,
1072+
13, "Authorization", "authorization", Authorization, authorization, String,
1073+
14, "Expect", "expect", Expect, expect, String,
1074+
15, "From", "from", From, from, String,
1075+
16, "Host", "host", Host, host, headers::host::Host,
1076+
17, "If-Match", "if-match", IfMatch, if_match, String,
1077+
18, "If-Modified-Since", "if-modified-since", IfModifiedSince, if_modified_since, time::Tm,
1078+
19, "If-None-Match", "if-none-match", IfNoneMatch, if_none_match, String,
1079+
20, "If-Range", "if-range", IfRange, if_range, String,
1080+
21, "If-Unmodified-Since", "if-unmodified-since", IfUnmodifiedSince, if_unmodified_since, time::Tm,
1081+
22, "Max-Forwards", "max-forwards", MaxForwards, max_forwards, uint,
1082+
23, "Proxy-Authorization", "proxy-authorization", ProxyAuthorization, proxy_authorization, String,
1083+
24, "Range", "range", Range, range, String,
1084+
25, "Referer", "referer", Referer, referer, String,
1085+
26, "TE", "te", Te, te, String,
1086+
27, "User-Agent", "user-agent", UserAgent, user_agent, String,
10871087

10881088
// RFC 2616, Section 7.1: Entity Header Fields
1089-
28, "Allow", "allow", Allow, allow, Vec<::method::Method>;
1090-
29, "Content-Encoding", "content-encoding", ContentEncoding, content_encoding, String;
1091-
30, "Content-Language", "content-language", ContentLanguage, content_language, String;
1092-
31, "Content-Length", "content-length", ContentLength, content_length, uint;
1093-
32, "Content-Location", "content-location", ContentLocation, content_location, String;
1094-
33, "Content-MD5", "content-md5", ContentMd5, content_md5, String;
1095-
34, "Content-Range", "content-range", ContentRange, content_range, String;
1096-
35, "Content-Type", "content-type", ContentType, content_type, headers::content_type::MediaType;
1097-
36, "Expires", "expires", Expires, expires, time::Tm;
1098-
37, "Last-Modified", "last-modified", LastModified, last_modified, time::Tm;
1089+
28, "Allow", "allow", Allow, allow, Vec<::method::Method>,
1090+
29, "Content-Encoding", "content-encoding", ContentEncoding, content_encoding, String,
1091+
30, "Content-Language", "content-language", ContentLanguage, content_language, String,
1092+
31, "Content-Length", "content-length", ContentLength, content_length, uint,
1093+
32, "Content-Location", "content-location", ContentLocation, content_location, String,
1094+
33, "Content-MD5", "content-md5", ContentMd5, content_md5, String,
1095+
34, "Content-Range", "content-range", ContentRange, content_range, String,
1096+
35, "Content-Type", "content-type", ContentType, content_type, headers::content_type::MediaType,
1097+
36, "Expires", "expires", Expires, expires, time::Tm,
1098+
37, "Last-Modified", "last-modified", LastModified, last_modified, time::Tm,
10991099
}
11001100

11011101
headers_mod! {
@@ -1105,39 +1105,39 @@ headers_mod! {
11051105
num_headers: 30;
11061106

11071107
// RFC 2616, Section 4.5: General Header Fields
1108-
0, "Cache-Control", "cache-control", CacheControl, cache_control, String;
1109-
1, "Connection", "connection", Connection, connection, Vec<headers::connection::Connection>;
1110-
2, "Date", "date", Date, date, time::Tm;
1111-
3, "Pragma", "pragma", Pragma, pragma, String;
1112-
4, "Trailer", "trailer", Trailer, trailer, String;
1113-
5, "Transfer-Encoding", "transfer-encoding", TransferEncoding, transfer_encoding, Vec<headers::transfer_encoding::TransferCoding>;
1114-
6, "Upgrade", "upgrade", Upgrade, upgrade, String;
1115-
7, "Via", "via", Via, via, String;
1116-
8, "Warning", "warning", Warning, warning, String;
1108+
0, "Cache-Control", "cache-control", CacheControl, cache_control, String,
1109+
1, "Connection", "connection", Connection, connection, Vec<headers::connection::Connection>,
1110+
2, "Date", "date", Date, date, time::Tm,
1111+
3, "Pragma", "pragma", Pragma, pragma, String,
1112+
4, "Trailer", "trailer", Trailer, trailer, String,
1113+
5, "Transfer-Encoding", "transfer-encoding", TransferEncoding, transfer_encoding, Vec<headers::transfer_encoding::TransferCoding>,
1114+
6, "Upgrade", "upgrade", Upgrade, upgrade, String,
1115+
7, "Via", "via", Via, via, String,
1116+
8, "Warning", "warning", Warning, warning, String,
11171117

11181118
// RFC 2616, Section 6.2: Response Header Fields
1119-
9, "Accept-Patch", "accept-patch", AcceptPatch, accept_patch, String;
1120-
10, "Accept-Ranges", "accept-ranges", AcceptRanges, accept_ranges, headers::accept_ranges::AcceptableRanges;
1121-
11, "Age", "age", Age, age, String;
1122-
12, "ETag", "etag", ETag, etag, headers::etag::EntityTag;
1123-
13, "Location", "location", Location, location, ::url::Url;
1124-
14, "Proxy-Authenticate", "proxy-authenticate", ProxyAuthenticate, proxy_authenticate, String;
1125-
15, "Retry-After", "retry-after", RetryAfter, retry_after, String;
1126-
16, "Server", "server", Server, server, String;
1127-
17, "Vary", "vary", Vary, vary, String;
1128-
18, "WWW-Authenticate", "www-authenticate", WwwAuthenticate, www_authenticate, String;
1119+
9, "Accept-Patch", "accept-patch", AcceptPatch, accept_patch, String,
1120+
10, "Accept-Ranges", "accept-ranges", AcceptRanges, accept_ranges, headers::accept_ranges::AcceptableRanges,
1121+
11, "Age", "age", Age, age, String,
1122+
12, "ETag", "etag", ETag, etag, headers::etag::EntityTag,
1123+
13, "Location", "location", Location, location, ::url::Url,
1124+
14, "Proxy-Authenticate", "proxy-authenticate", ProxyAuthenticate, proxy_authenticate, String,
1125+
15, "Retry-After", "retry-after", RetryAfter, retry_after, String,
1126+
16, "Server", "server", Server, server, String,
1127+
17, "Vary", "vary", Vary, vary, String,
1128+
18, "WWW-Authenticate", "www-authenticate", WwwAuthenticate, www_authenticate, String,
11291129

11301130
// RFC 2616, Section 7.1: Entity Header Fields
1131-
19, "Allow", "allow", Allow, allow, Vec<::method::Method>;
1132-
20, "Content-Encoding", "content-encoding", ContentEncoding, content_encoding, String;
1133-
21, "Content-Language", "content-language", ContentLanguage, content_language, String;
1134-
22, "Content-Length", "content-length", ContentLength, content_length, uint;
1135-
23, "Content-Location", "content-location", ContentLocation, content_location, String;
1136-
24, "Content-MD5", "content-md5", ContentMd5, content_md5, String;
1137-
25, "Content-Range", "content-range", ContentRange, content_range, String;
1138-
26, "Content-Type", "content-type", ContentType, content_type, headers::content_type::MediaType;
1139-
27, "Expires", "expires", Expires, expires, String; // TODO: Should be Tm
1140-
28, "Last-Modified", "last-modified", LastModified, last_modified, time::Tm;
1141-
1142-
29, "Access-Control-Allow-Origin", "access-control-allow-origin", AccessControlAllowOrigin, access_control_allow_origin, String;
1131+
19, "Allow", "allow", Allow, allow, Vec<::method::Method>,
1132+
20, "Content-Encoding", "content-encoding", ContentEncoding, content_encoding, String,
1133+
21, "Content-Language", "content-language", ContentLanguage, content_language, String,
1134+
22, "Content-Length", "content-length", ContentLength, content_length, uint,
1135+
23, "Content-Location", "content-location", ContentLocation, content_location, String,
1136+
24, "Content-MD5", "content-md5", ContentMd5, content_md5, String,
1137+
25, "Content-Range", "content-range", ContentRange, content_range, String,
1138+
26, "Content-Type", "content-type", ContentType, content_type, headers::content_type::MediaType,
1139+
27, "Expires", "expires", Expires, expires, String, // TODO: Should be Tm
1140+
28, "Last-Modified", "last-modified", LastModified, last_modified, time::Tm,
1141+
1142+
29, "Access-Control-Allow-Origin", "access-control-allow-origin", AccessControlAllowOrigin, access_control_allow_origin, String,
11431143
}

0 commit comments

Comments
 (0)