Repository: actix/actix-web
File: src/http/header/accept_language.rs (Rust)

Code before:
    /// ```
    ///
    /// # Example values
    /// * `da, en-gb;q=0.8, en;q=0.7`
    /// * `en-us;q=1.0, en;q=0.5, fr`
    ///
    /// # Examples
    ///
    /// ```
    /// use language_tags::LanguageTag;
    /// use actix_web::HttpResponse;
    /// use actix_web::http::header::{AcceptLanguage, qitem};
    ///
    /// let mut builder = HttpResponse::Ok();
    /// let langtag = LanguageTag::parse("en-US").unwrap();
    /// builder.insert_header(
    ///     AcceptLanguage(vec![
    ///         qitem(langtag),
    ///     ])
    /// );
    /// ```
    ///
    /// ```
    /// use language_tags::LanguageTag;
    /// use actix_web::HttpResponse;
    /// use actix_web::http::header::{AcceptLanguage, QualityItem, q, qitem};
    ///
    /// let mut builder = HttpResponse::Ok();
    /// builder.insert_header(
    ///     AcceptLanguage(vec![
    ///         qitem(LanguageTag::parse("da").unwrap()),
    ///         QualityItem::new(LanguageTag::parse("en-GB").unwrap(), q(800)),
    ///         QualityItem::new(LanguageTag::parse("en").unwrap(), q(700)),
    ///     ])
    /// );
    /// ```
    (AcceptLanguage, ACCEPT_LANGUAGE) => (QualityItem<LanguageTag>)+

    test_accept_language {
        // From the RFC
        crate::__common_header_test!(test1, vec![b"da, en-gb;q=0.8, en;q=0.7"]);
        // Own test
        crate::__common_header_test!(
            test2, vec![b"en-US, en; q=0.5, fr"],
            Some(AcceptLanguage(vec![
                qitem("en-US".parse().unwrap()),
                QualityItem::new("en".parse().unwrap(), q(500)),
                qitem("fr".parse().unwrap()),
        ])));
    }
}

Review comment (suggestion):
```suggestion
    /// use actix_web::http::header::{AcceptLanguage, LanguageTag, QualityItem, q, qitem};
```

Code after:
    /// ```
    ///
    /// # Example values
    /// * `da, en-gb;q=0.8, en;q=0.7`
    /// * `en-us;q=1.0, en;q=0.5, fr`
    ///
    /// # Examples
    ///
    /// ```
    /// use actix_web::HttpResponse;
    /// use actix_web::http::header::{AcceptLanguage, LanguageTag, qitem};
    ///
    /// let mut builder = HttpResponse::Ok();
    /// let langtag = LanguageTag::parse("en-US").unwrap();
    /// builder.insert_header(
    ///     AcceptLanguage(vec![
    ///         qitem(langtag),
    ///     ])
    /// );
    /// ```
    ///
    /// ```
    /// use actix_web::HttpResponse;
    /// use actix_web::http::header::{AcceptLanguage, LanguageTag, QualityItem, q, qitem};
    ///
    /// let mut builder = HttpResponse::Ok();
    /// builder.insert_header(
    ///     AcceptLanguage(vec![
    ///         qitem(LanguageTag::parse("da").unwrap()),
    ///         QualityItem::new(LanguageTag::parse("en-GB").unwrap(), q(800)),
    ///         QualityItem::new(LanguageTag::parse("en").unwrap(), q(700)),
    ///     ])
    /// );
    /// ```
    (AcceptLanguage, ACCEPT_LANGUAGE) => (QualityItem<LanguageTag>)+

    test_accept_language {
        // From the RFC
        crate::__common_header_test!(test1, vec![b"da, en-gb;q=0.8, en;q=0.7"]);
        // Own test
        crate::__common_header_test!(
            test2, vec![b"en-US, en; q=0.5, fr"],
            Some(AcceptLanguage(vec![
                qitem("en-US".parse().unwrap()),
                QualityItem::new("en".parse().unwrap(), q(500)),
                qitem("fr".parse().unwrap()),
        ])));
    }
}