1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-20 16:41:05 +00:00

update tests for stable compiler

This commit is contained in:
Nikolay Kim 2018-03-06 07:56:43 -08:00
parent 7eb310f8ce
commit 526753ee88
5 changed files with 24 additions and 2 deletions

View file

@ -34,6 +34,7 @@ header! {
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::{Accept, qitem};
///
/// # fn main() {
/// let mut builder = HttpOk.build();
///
/// builder.set(
@ -41,6 +42,7 @@ header! {
/// qitem(mime::TEXT_HTML),
/// ])
/// );
/// # }
/// ```
///
/// ```rust
@ -49,6 +51,7 @@ header! {
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::{Accept, qitem};
///
/// # fn main() {
/// let mut builder = HttpOk.build();
///
/// builder.set(
@ -56,6 +59,7 @@ header! {
/// qitem(mime::APPLICATION_JSON),
/// ])
/// );
/// # }
/// ```
///
/// ```rust
@ -64,6 +68,7 @@ header! {
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::{Accept, QualityItem, q, qitem};
///
/// # fn main() {
/// let mut builder = HttpOk.build();
///
/// builder.set(
@ -81,6 +86,7 @@ header! {
/// ),
/// ])
/// );
/// # }
/// ```
(Accept, http::ACCEPT) => (QualityItem<Mime>)+

View file

@ -26,16 +26,19 @@ header! {
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::{AcceptCharset, Charset, qitem};
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// builder.set(
/// AcceptCharset(vec![qitem(Charset::Us_Ascii)])
/// );
/// # }
/// ```
/// ```rust
/// # extern crate actix_web;
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::{AcceptCharset, Charset, q, QualityItem};
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// builder.set(
/// AcceptCharset(vec![
@ -43,16 +46,19 @@ header! {
/// QualityItem::new(Charset::Iso_8859_10, q(200)),
/// ])
/// );
/// # }
/// ```
/// ```rust
/// # extern crate actix_web;
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::{AcceptCharset, Charset, qitem};
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// builder.set(
/// AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
/// );
/// # }
/// ```
(AcceptCharset, http::ACCEPT_CHARSET) => (QualityItem<Charset>)+

View file

@ -29,6 +29,7 @@ header! {
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::{AcceptLanguage, LanguageTag, qitem};
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// let mut langtag: LanguageTag = Default::default();
/// langtag.language = Some("en".to_owned());
@ -38,6 +39,7 @@ header! {
/// qitem(langtag),
/// ])
/// );
/// # }
/// ```
///
/// ```rust

View file

@ -29,10 +29,12 @@ header! {
/// use actix_web::header::Allow;
/// use http::Method;
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// builder.set(
/// Allow(vec![Method::GET])
/// );
/// # }
/// ```
///
/// ```rust
@ -42,6 +44,7 @@ header! {
/// use actix_web::header::Allow;
/// use http::Method;
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// builder.set(
/// Allow(vec![
@ -50,6 +53,7 @@ header! {
/// Method::PATCH,
/// ])
/// );
/// # }
/// ```
(Allow, http::ALLOW) => (Method)*

View file

@ -35,23 +35,27 @@ header! {
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::ContentType;
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// builder.set(
/// ContentType::json()
/// );
/// # }
/// ```
///
/// ```rust
/// # extern crate mime;
/// # extern crate actix_web;
/// use mime;
/// use mime::TEXT_HTML;
/// use actix_web::httpcodes::HttpOk;
/// use actix_web::header::ContentType;
///
/// # fn main() {
/// let mut builder = HttpOk.build();
/// builder.set(
/// ContentType(mime::TEXT_HTML)
/// ContentType(TEXT_HTML)
/// );
/// # }
/// ```
(ContentType, http::CONTENT_TYPE) => [Mime]