@@ -24,12 +24,12 @@ struct Status {
24
24
}
25
25
26
26
/// Status with comment
27
- fn StatusC ( code : uint , reason : & ' static str , comment : & ' static str ) -> HeadingOrStatus {
27
+ fn status_c ( code : uint , reason : & ' static str , comment : & ' static str ) -> HeadingOrStatus {
28
28
Status ( Status { code : code, reason : reason, comment : Some ( comment) } )
29
29
}
30
30
31
31
/// Status without comment
32
- fn StatusN ( code : uint , reason : & ' static str ) -> HeadingOrStatus {
32
+ fn status_n ( code : uint , reason : & ' static str ) -> HeadingOrStatus {
33
33
Status ( Status { code : code, reason : reason, comment : None } )
34
34
}
35
35
@@ -74,77 +74,77 @@ pub fn generate(output_dir: &Path) -> IoResult<()> {
74
74
let mut out = get_writer ( output_dir, "status.rs" ) ;
75
75
let entries = [
76
76
Heading ( "1xx Informational" ) ,
77
- StatusN ( 100 , "Continue" ) ,
78
- StatusN ( 101 , "Switching Protocols" ) ,
79
- StatusC ( 102 , "Processing" , "WebDAV; RFC 2518" ) ,
77
+ status_n ( 100 , "Continue" ) ,
78
+ status_n ( 101 , "Switching Protocols" ) ,
79
+ status_c ( 102 , "Processing" , "WebDAV; RFC 2518" ) ,
80
80
81
81
Heading ( "2xx Success" ) ,
82
- StatusN ( 200 , "OK" ) ,
83
- StatusN ( 201 , "Created" ) ,
84
- StatusN ( 202 , "Accepted" ) ,
85
- StatusC ( 203 , "Non-Authoritative Information" , "since HTTP/1.1" ) ,
86
- StatusN ( 204 , "No Content" ) ,
87
- StatusN ( 205 , "Reset Content" ) ,
88
- StatusN ( 206 , "Partial Content" ) ,
89
- StatusC ( 207 , "Multi-Status" , "WebDAV; RFC 4918" ) ,
90
- StatusC ( 208 , "Already Reported" , "WebDAV; RFC 5842" ) ,
91
- StatusC ( 226 , "IM Used" , "RFC 3229" ) ,
82
+ status_n ( 200 , "OK" ) ,
83
+ status_n ( 201 , "Created" ) ,
84
+ status_n ( 202 , "Accepted" ) ,
85
+ status_c ( 203 , "Non-Authoritative Information" , "since HTTP/1.1" ) ,
86
+ status_n ( 204 , "No Content" ) ,
87
+ status_n ( 205 , "Reset Content" ) ,
88
+ status_n ( 206 , "Partial Content" ) ,
89
+ status_c ( 207 , "Multi-Status" , "WebDAV; RFC 4918" ) ,
90
+ status_c ( 208 , "Already Reported" , "WebDAV; RFC 5842" ) ,
91
+ status_c ( 226 , "IM Used" , "RFC 3229" ) ,
92
92
93
93
Heading ( "3xx Redirection" ) ,
94
- StatusN ( 300 , "Multiple Choices" ) ,
95
- StatusN ( 301 , "Moved Permanently" ) ,
96
- StatusN ( 302 , "Found" ) ,
97
- StatusC ( 303 , "See Other" , "since HTTP/1.1" ) ,
98
- StatusN ( 304 , "Not Modified" ) ,
99
- StatusC ( 305 , "Use Proxy" , "since HTTP/1.1" ) ,
100
- StatusN ( 306 , "Switch Proxy" ) ,
101
- StatusC ( 307 , "Temporary Redirect" , "since HTTP/1.1" ) ,
102
- StatusC ( 308 , "Permanent Redirect" , "approved as experimental RFC: http://tools.ietf.org/html/draft-reschke-http-status-308" ) ,
94
+ status_n ( 300 , "Multiple Choices" ) ,
95
+ status_n ( 301 , "Moved Permanently" ) ,
96
+ status_n ( 302 , "Found" ) ,
97
+ status_c ( 303 , "See Other" , "since HTTP/1.1" ) ,
98
+ status_n ( 304 , "Not Modified" ) ,
99
+ status_c ( 305 , "Use Proxy" , "since HTTP/1.1" ) ,
100
+ status_n ( 306 , "Switch Proxy" ) ,
101
+ status_c ( 307 , "Temporary Redirect" , "since HTTP/1.1" ) ,
102
+ status_c ( 308 , "Permanent Redirect" , "approved as experimental RFC: http://tools.ietf.org/html/draft-reschke-http-status-308" ) ,
103
103
104
104
Heading ( "4xx Client Error" ) ,
105
- StatusN ( 400 , "Bad Request" ) ,
106
- StatusN ( 401 , "Unauthorized" ) ,
107
- StatusN ( 402 , "Payment Required" ) ,
108
- StatusN ( 403 , "Forbidden" ) ,
109
- StatusN ( 404 , "Not Found" ) ,
110
- StatusN ( 405 , "Method Not Allowed" ) ,
111
- StatusN ( 406 , "Not Acceptable" ) ,
112
- StatusN ( 407 , "Proxy Authentication Required" ) ,
113
- StatusN ( 408 , "Request Timeout" ) ,
114
- StatusN ( 409 , "Conflict" ) ,
115
- StatusN ( 410 , "Gone" ) ,
116
- StatusN ( 411 , "Length Required" ) ,
117
- StatusN ( 412 , "Precondition Failed" ) ,
118
- StatusN ( 413 , "Request Entity Too Large" ) ,
119
- StatusN ( 414 , "Request-URI Too Long" ) ,
120
- StatusN ( 415 , "Unsupported Media Type" ) ,
121
- StatusN ( 416 , "Requested Range Not Satisfiable" ) ,
122
- StatusN ( 417 , "Expectation Failed" ) ,
123
- StatusC ( 418 , "I'm a teapot" , "RFC 2324" ) ,
124
- StatusN ( 419 , "Authentication Timeout" ) ,
125
- StatusC ( 422 , "Unprocessable Entity" , "WebDAV; RFC 4918" ) ,
126
- StatusC ( 423 , "Locked" , "WebDAV; RFC 4918" ) ,
127
- StatusC ( 424 , "Failed Dependency" , "WebDAV; RFC 4918" ) ,
128
- StatusC ( 424 , "Method Failure" , "WebDAV" ) ,
129
- StatusC ( 425 , "Unordered Collection" , "Internet draft" ) ,
130
- StatusC ( 426 , "Upgrade Required" , "RFC 2817" ) ,
131
- StatusC ( 428 , "Precondition Required" , "RFC 6585" ) ,
132
- StatusC ( 429 , "Too Many Requests" , "RFC 6585" ) ,
133
- StatusC ( 431 , "Request Header Fields Too Large" , "RFC 6585" ) ,
134
- StatusC ( 451 , "Unavailable For Legal Reasons" , "Internet draft" ) ,
105
+ status_n ( 400 , "Bad Request" ) ,
106
+ status_n ( 401 , "Unauthorized" ) ,
107
+ status_n ( 402 , "Payment Required" ) ,
108
+ status_n ( 403 , "Forbidden" ) ,
109
+ status_n ( 404 , "Not Found" ) ,
110
+ status_n ( 405 , "Method Not Allowed" ) ,
111
+ status_n ( 406 , "Not Acceptable" ) ,
112
+ status_n ( 407 , "Proxy Authentication Required" ) ,
113
+ status_n ( 408 , "Request Timeout" ) ,
114
+ status_n ( 409 , "Conflict" ) ,
115
+ status_n ( 410 , "Gone" ) ,
116
+ status_n ( 411 , "Length Required" ) ,
117
+ status_n ( 412 , "Precondition Failed" ) ,
118
+ status_n ( 413 , "Request Entity Too Large" ) ,
119
+ status_n ( 414 , "Request-URI Too Long" ) ,
120
+ status_n ( 415 , "Unsupported Media Type" ) ,
121
+ status_n ( 416 , "Requested Range Not Satisfiable" ) ,
122
+ status_n ( 417 , "Expectation Failed" ) ,
123
+ status_c ( 418 , "I'm a teapot" , "RFC 2324" ) ,
124
+ status_n ( 419 , "Authentication Timeout" ) ,
125
+ status_c ( 422 , "Unprocessable Entity" , "WebDAV; RFC 4918" ) ,
126
+ status_c ( 423 , "Locked" , "WebDAV; RFC 4918" ) ,
127
+ status_c ( 424 , "Failed Dependency" , "WebDAV; RFC 4918" ) ,
128
+ status_c ( 424 , "Method Failure" , "WebDAV" ) ,
129
+ status_c ( 425 , "Unordered Collection" , "Internet draft" ) ,
130
+ status_c ( 426 , "Upgrade Required" , "RFC 2817" ) ,
131
+ status_c ( 428 , "Precondition Required" , "RFC 6585" ) ,
132
+ status_c ( 429 , "Too Many Requests" , "RFC 6585" ) ,
133
+ status_c ( 431 , "Request Header Fields Too Large" , "RFC 6585" ) ,
134
+ status_c ( 451 , "Unavailable For Legal Reasons" , "Internet draft" ) ,
135
135
136
136
Heading ( "5xx Server Error" ) ,
137
- StatusN ( 500 , "Internal Server Error" ) ,
138
- StatusN ( 501 , "Not Implemented" ) ,
139
- StatusN ( 502 , "Bad Gateway" ) ,
140
- StatusN ( 503 , "Service Unavailable" ) ,
141
- StatusN ( 504 , "Gateway Timeout" ) ,
142
- StatusN ( 505 , "HTTP Version Not Supported" ) ,
143
- StatusC ( 506 , "Variant Also Negotiates" , "RFC 2295" ) ,
144
- StatusC ( 507 , "Insufficient Storage" , "WebDAV; RFC 4918" ) ,
145
- StatusC ( 508 , "Loop Detected" , "WebDAV; RFC 5842" ) ,
146
- StatusC ( 510 , "Not Extended" , "RFC 2774" ) ,
147
- StatusC ( 511 , "Network Authentication Required" , "RFC 6585" ) ,
137
+ status_n ( 500 , "Internal Server Error" ) ,
138
+ status_n ( 501 , "Not Implemented" ) ,
139
+ status_n ( 502 , "Bad Gateway" ) ,
140
+ status_n ( 503 , "Service Unavailable" ) ,
141
+ status_n ( 504 , "Gateway Timeout" ) ,
142
+ status_n ( 505 , "HTTP Version Not Supported" ) ,
143
+ status_c ( 506 , "Variant Also Negotiates" , "RFC 2295" ) ,
144
+ status_c ( 507 , "Insufficient Storage" , "WebDAV; RFC 4918" ) ,
145
+ status_c ( 508 , "Loop Detected" , "WebDAV; RFC 5842" ) ,
146
+ status_c ( 510 , "Not Extended" , "RFC 2774" ) ,
147
+ status_c ( 511 , "Network Authentication Required" , "RFC 6585" ) ,
148
148
] ;
149
149
unsafe {
150
150
longest_ident = entries. iter ( ) . map ( |& e| match e {
0 commit comments