1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

improve typed header macro (#2481)

This commit is contained in:
Rob Ede
2021-12-02 15:25:39 +00:00
committed by GitHub
parent 075d871e63
commit 2a72bdae09
29 changed files with 147 additions and 100 deletions

View File

@@ -15,7 +15,7 @@ common_header! {
/// ranges defined in [RFC 4647 §2.1](https://datatracker.ietf.org/doc/html/rfc4647#section-2.1).
///
/// # ABNF
/// ```text
/// ```plain
/// Accept-Language = 1#( language-range [ weight ] )
/// language-range = (1*8ALPHA *("-" 1*8alphanum)) / "*"
/// alphanum = ALPHA / DIGIT
@@ -57,7 +57,7 @@ common_header! {
/// ```
(AcceptLanguage, header::ACCEPT_LANGUAGE) => (QualityItem<Preference<LanguageTag>>)*
parse_and_fmt_tests {
test_parse_and_format {
common_header_test!(no_headers, vec![b""; 0], Some(AcceptLanguage(vec![])));
common_header_test!(empty_header, vec![b""; 1], Some(AcceptLanguage(vec![])));