mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 09:42:40 +01:00
update tests for stable compiler
This commit is contained in:
parent
7eb310f8ce
commit
526753ee88
@ -34,6 +34,7 @@ header! {
|
|||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::{Accept, qitem};
|
/// use actix_web::header::{Accept, qitem};
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
///
|
///
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
@ -41,6 +42,7 @@ header! {
|
|||||||
/// qitem(mime::TEXT_HTML),
|
/// qitem(mime::TEXT_HTML),
|
||||||
/// ])
|
/// ])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
@ -49,6 +51,7 @@ header! {
|
|||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::{Accept, qitem};
|
/// use actix_web::header::{Accept, qitem};
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
///
|
///
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
@ -56,6 +59,7 @@ header! {
|
|||||||
/// qitem(mime::APPLICATION_JSON),
|
/// qitem(mime::APPLICATION_JSON),
|
||||||
/// ])
|
/// ])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
@ -64,6 +68,7 @@ header! {
|
|||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::{Accept, QualityItem, q, qitem};
|
/// use actix_web::header::{Accept, QualityItem, q, qitem};
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
///
|
///
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
@ -81,6 +86,7 @@ header! {
|
|||||||
/// ),
|
/// ),
|
||||||
/// ])
|
/// ])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
(Accept, http::ACCEPT) => (QualityItem<Mime>)+
|
(Accept, http::ACCEPT) => (QualityItem<Mime>)+
|
||||||
|
|
||||||
|
@ -26,16 +26,19 @@ header! {
|
|||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::{AcceptCharset, Charset, qitem};
|
/// use actix_web::header::{AcceptCharset, Charset, qitem};
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
/// AcceptCharset(vec![qitem(Charset::Us_Ascii)])
|
/// AcceptCharset(vec![qitem(Charset::Us_Ascii)])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # extern crate actix_web;
|
/// # extern crate actix_web;
|
||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::{AcceptCharset, Charset, q, QualityItem};
|
/// use actix_web::header::{AcceptCharset, Charset, q, QualityItem};
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
/// AcceptCharset(vec![
|
/// AcceptCharset(vec![
|
||||||
@ -43,16 +46,19 @@ header! {
|
|||||||
/// QualityItem::new(Charset::Iso_8859_10, q(200)),
|
/// QualityItem::new(Charset::Iso_8859_10, q(200)),
|
||||||
/// ])
|
/// ])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # extern crate actix_web;
|
/// # extern crate actix_web;
|
||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::{AcceptCharset, Charset, qitem};
|
/// use actix_web::header::{AcceptCharset, Charset, qitem};
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
/// AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
|
/// AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
(AcceptCharset, http::ACCEPT_CHARSET) => (QualityItem<Charset>)+
|
(AcceptCharset, http::ACCEPT_CHARSET) => (QualityItem<Charset>)+
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ header! {
|
|||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::{AcceptLanguage, LanguageTag, qitem};
|
/// use actix_web::header::{AcceptLanguage, LanguageTag, qitem};
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
/// let mut langtag: LanguageTag = Default::default();
|
/// let mut langtag: LanguageTag = Default::default();
|
||||||
/// langtag.language = Some("en".to_owned());
|
/// langtag.language = Some("en".to_owned());
|
||||||
@ -38,6 +39,7 @@ header! {
|
|||||||
/// qitem(langtag),
|
/// qitem(langtag),
|
||||||
/// ])
|
/// ])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
|
@ -29,10 +29,12 @@ header! {
|
|||||||
/// use actix_web::header::Allow;
|
/// use actix_web::header::Allow;
|
||||||
/// use http::Method;
|
/// use http::Method;
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
/// Allow(vec![Method::GET])
|
/// Allow(vec![Method::GET])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
@ -42,6 +44,7 @@ header! {
|
|||||||
/// use actix_web::header::Allow;
|
/// use actix_web::header::Allow;
|
||||||
/// use http::Method;
|
/// use http::Method;
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
/// Allow(vec![
|
/// Allow(vec![
|
||||||
@ -50,6 +53,7 @@ header! {
|
|||||||
/// Method::PATCH,
|
/// Method::PATCH,
|
||||||
/// ])
|
/// ])
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
(Allow, http::ALLOW) => (Method)*
|
(Allow, http::ALLOW) => (Method)*
|
||||||
|
|
||||||
|
@ -35,23 +35,27 @@ header! {
|
|||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::ContentType;
|
/// use actix_web::header::ContentType;
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
/// ContentType::json()
|
/// ContentType::json()
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # extern crate mime;
|
/// # extern crate mime;
|
||||||
/// # extern crate actix_web;
|
/// # extern crate actix_web;
|
||||||
/// use mime;
|
/// use mime::TEXT_HTML;
|
||||||
/// use actix_web::httpcodes::HttpOk;
|
/// use actix_web::httpcodes::HttpOk;
|
||||||
/// use actix_web::header::ContentType;
|
/// use actix_web::header::ContentType;
|
||||||
///
|
///
|
||||||
|
/// # fn main() {
|
||||||
/// let mut builder = HttpOk.build();
|
/// let mut builder = HttpOk.build();
|
||||||
/// builder.set(
|
/// builder.set(
|
||||||
/// ContentType(mime::TEXT_HTML)
|
/// ContentType(TEXT_HTML)
|
||||||
/// );
|
/// );
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
(ContentType, http::CONTENT_TYPE) => [Mime]
|
(ContentType, http::CONTENT_TYPE) => [Mime]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user