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

simplify http response construction; deprecate httpcodes

This commit is contained in:
Nikolay Kim
2018-03-30 23:07:33 -07:00
parent 8d8f6bedad
commit 44e3df82f6
58 changed files with 561 additions and 539 deletions

View File

@@ -1,7 +1,6 @@
use language_tags::LanguageTag;
use header::{ACCEPT_LANGUAGE, QualityItem};
header! {
/// `Accept-Language` header, defined in
/// [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.5)
@@ -26,11 +25,11 @@ header! {
/// ```rust
/// # extern crate actix_web;
/// # extern crate language_tags;
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::HttpResponse;
/// use actix_web::http::header::{AcceptLanguage, LanguageTag, qitem};
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// let mut builder = HttpResponse::Ok();
/// let mut langtag: LanguageTag = Default::default();
/// langtag.language = Some("en".to_owned());
/// langtag.region = Some("US".to_owned());
@@ -45,11 +44,11 @@ header! {
/// ```rust
/// # extern crate actix_web;
/// # #[macro_use] extern crate language_tags;
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::HttpResponse;
/// use actix_web::http::header::{AcceptLanguage, QualityItem, q, qitem};
/// #
/// # fn main() {
/// let mut builder = HttpOk.build();
/// let mut builder = HttpResponse::Ok();
/// builder.set(
/// AcceptLanguage(vec![
/// qitem(langtag!(da)),