@@ -879,14 +879,14 @@ macro_rules! headers_mod {
879
879
// Not using this because of a "local ambiguity" bug
880
880
//$($attrs:attr)*
881
881
pub mod $mod_name: ident;
882
- num_headers: $num_headers: pat ;
882
+ num_headers: $num_headers: expr ;
883
883
$(
884
884
$num_id: pat,
885
885
$output_name: expr,
886
886
$input_name: pat,
887
887
$caps_ident: ident,
888
888
$lower_ident: ident,
889
- $htype: ty;
889
+ $htype: ty,
890
890
) *
891
891
} => {
892
892
pub mod $mod_name {
@@ -1054,48 +1054,48 @@ headers_mod! {
1054
1054
num_headers: 38 ;
1055
1055
1056
1056
// 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 ,
1066
1066
1067
1067
// 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 ,
1087
1087
1088
1088
// 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 ,
1099
1099
}
1100
1100
1101
1101
headers_mod ! {
@@ -1105,39 +1105,39 @@ headers_mod! {
1105
1105
num_headers: 30 ;
1106
1106
1107
1107
// 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 ,
1117
1117
1118
1118
// 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 ,
1129
1129
1130
1130
// 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 ,
1143
1143
}
0 commit comments