From 526753ee88cecdaa9afe9e8ec1bd7fd117f658d1 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 6 Mar 2018 07:56:43 -0800 Subject: [PATCH] update tests for stable compiler --- src/header/common/accept.rs | 6 ++++++ src/header/common/accept_charset.rs | 6 ++++++ src/header/common/accept_language.rs | 2 ++ src/header/common/allow.rs | 4 ++++ src/header/common/content_type.rs | 8 ++++++-- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/header/common/accept.rs b/src/header/common/accept.rs index 84a1d800b..b0dca4459 100644 --- a/src/header/common/accept.rs +++ b/src/header/common/accept.rs @@ -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)+ diff --git a/src/header/common/accept_charset.rs b/src/header/common/accept_charset.rs index 781445ded..1e798ad6d 100644 --- a/src/header/common/accept_charset.rs +++ b/src/header/common/accept_charset.rs @@ -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)+ diff --git a/src/header/common/accept_language.rs b/src/header/common/accept_language.rs index 916181b42..a2486c60c 100644 --- a/src/header/common/accept_language.rs +++ b/src/header/common/accept_language.rs @@ -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 diff --git a/src/header/common/allow.rs b/src/header/common/allow.rs index 274c691f6..87c02897c 100644 --- a/src/header/common/allow.rs +++ b/src/header/common/allow.rs @@ -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)* diff --git a/src/header/common/content_type.rs b/src/header/common/content_type.rs index 730bbd947..c2e1bad01 100644 --- a/src/header/common/content_type.rs +++ b/src/header/common/content_type.rs @@ -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]