1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 01:32:57 +01:00

fix rustfmt formatting

This commit is contained in:
Nikolay Kim 2018-06-01 10:27:23 -07:00
parent 3f5a39a5b7
commit c8930b7b6b
11 changed files with 24 additions and 24 deletions

View File

@ -1,5 +1,5 @@
max_width = 89 max_width = 89
reorder_imports = true reorder_imports = true
wrap_comments = true #wrap_comments = true
fn_args_density = "Compressed" fn_args_density = "Compressed"
#use_small_heuristics = false #use_small_heuristics = false

View File

@ -634,7 +634,7 @@ where
/// struct State2; /// struct State2;
/// ///
/// fn main() { /// fn main() {
/// //#### # thread::spawn(|| { /// # thread::spawn(|| {
/// server::new(|| { /// server::new(|| {
/// vec![ /// vec![
/// App::with_state(State1) /// App::with_state(State1)
@ -649,7 +649,7 @@ where
/// }).bind("127.0.0.1:8080") /// }).bind("127.0.0.1:8080")
/// .unwrap() /// .unwrap()
/// .run() /// .run()
/// //#### # }); /// # });
/// } /// }
/// ``` /// ```
pub fn boxed(mut self) -> Box<HttpHandler> { pub fn boxed(mut self) -> Box<HttpHandler> {

View File

@ -120,13 +120,13 @@ where
/// ## Example /// ## Example
/// ///
/// ```rust /// ```rust
/// //#### # extern crate bytes; /// # extern crate bytes;
/// //#### # extern crate actix_web; /// # extern crate actix_web;
/// //#### # extern crate futures; /// # extern crate futures;
/// //#### #[macro_use] extern crate serde_derive; /// #[macro_use] extern crate serde_derive;
/// use actix_web::{App, Query, http}; /// use actix_web::{App, Query, http};
/// ///
/// //#### #[derive(Deserialize)] /// #[derive(Deserialize)]
/// struct Info { /// struct Info {
/// username: String, /// username: String,
/// } /// }

View File

@ -231,7 +231,7 @@ pub trait HttpMessage {
/// # extern crate futures; /// # extern crate futures;
/// # use std::str; /// # use std::str;
/// # use actix_web::*; /// # use actix_web::*;
/// # use actix_web::actix::*; /// # use actix_web::actix::fut::FinishStream;
/// # use futures::{Future, Stream}; /// # use futures::{Future, Stream};
/// # use futures::future::{ok, result, Either}; /// # use futures::future::{ok, result, Either};
/// fn index(mut req: HttpRequest) -> Box<Future<Item = HttpResponse, Error = Error>> { /// fn index(mut req: HttpRequest) -> Box<Future<Item = HttpResponse, Error = Error>> {

View File

@ -283,9 +283,9 @@ impl<S> HttpRequest<S> {
/// Generate url for named resource /// Generate url for named resource
/// ///
/// ```rust /// ```rust
/// //#### # extern crate actix_web; /// # extern crate actix_web;
/// //#### # use actix_web::{App, HttpRequest, HttpResponse, http}; /// # use actix_web::{App, HttpRequest, HttpResponse, http};
/// //#### # /// #
/// fn index(req: HttpRequest) -> HttpResponse { /// fn index(req: HttpRequest) -> HttpResponse {
/// let url = req.url_for("foo", &["1", "2", "3"]); // <- generate url for "foo" resource /// let url = req.url_for("foo", &["1", "2", "3"]); // <- generate url for "foo" resource
/// HttpResponse::Ok().into() /// HttpResponse::Ok().into()

View File

@ -32,11 +32,11 @@ use httpresponse::HttpResponse;
/// ## Example /// ## Example
/// ///
/// ```rust /// ```rust
/// //#### # extern crate actix_web; /// # extern crate actix_web;
/// //#### #[macro_use] extern crate serde_derive; /// #[macro_use] extern crate serde_derive;
/// use actix_web::{App, Json, Result, http}; /// use actix_web::{App, Json, Result, http};
/// ///
/// //#### #[derive(Deserialize)] /// #[derive(Deserialize)]
/// struct Info { /// struct Info {
/// username: String, /// username: String,
/// } /// }

View File

@ -10,13 +10,13 @@
//! } //! }
//! //!
//! fn main() { //! fn main() {
//! //#### # thread::spawn(|| { //! # thread::spawn(|| {
//! server::new(|| { //! server::new(|| {
//! App::new().resource("/{name}/{id}/index.html", |r| r.with(index)) //! App::new().resource("/{name}/{id}/index.html", |r| r.with(index))
//! }).bind("127.0.0.1:8080") //! }).bind("127.0.0.1:8080")
//! .unwrap() //! .unwrap()
//! .run(); //! .run();
//! //#### # }); //! # });
//! } //! }
//! ``` //! ```
//! //!

View File

@ -32,8 +32,8 @@
//! session data. //! session data.
//! //!
//! ```rust //! ```rust
//! //#### # extern crate actix_web; //! # extern crate actix_web;
//! use actix_web::{server, App, HttpRequest, Result}; //! use actix_web::{actix, server, App, HttpRequest, Result};
//! use actix_web::middleware::session::{RequestSession, SessionStorage, CookieSessionBackend}; //! use actix_web::middleware::session::{RequestSession, SessionStorage, CookieSessionBackend};
//! //!
//! fn index(req: HttpRequest) -> Result<&'static str> { //! fn index(req: HttpRequest) -> Result<&'static str> {
@ -58,7 +58,7 @@
//! ))) //! )))
//! .bind("127.0.0.1:59880").unwrap() //! .bind("127.0.0.1:59880").unwrap()
//! .start(); //! .start();
//! //#### # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0)); //! # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
//! }); //! });
//! } //! }
//! ``` //! ```

View File

@ -24,7 +24,7 @@ use route::Route;
/// predicates route route considered matched and route handler get called. /// predicates route route considered matched and route handler get called.
/// ///
/// ```rust /// ```rust
/// //#### # extern crate actix_web; /// # extern crate actix_web;
/// use actix_web::{App, HttpResponse, http}; /// use actix_web::{App, HttpResponse, http};
/// ///
/// fn main() { /// fn main() {

View File

@ -42,7 +42,7 @@ pub(crate) const MAX_WRITE_BUFFER_SIZE: usize = 65_536;
/// This is shortcut for `server::HttpServer::new()` method. /// This is shortcut for `server::HttpServer::new()` method.
/// ///
/// ```rust /// ```rust
/// //#### # extern crate actix_web; /// # extern crate actix_web;
/// use actix_web::{actix, server, App, HttpResponse}; /// use actix_web::{actix, server, App, HttpResponse};
/// ///
/// fn main() { /// fn main() {
@ -54,7 +54,7 @@ pub(crate) const MAX_WRITE_BUFFER_SIZE: usize = 65_536;
/// .bind("127.0.0.1:59090").unwrap() /// .bind("127.0.0.1:59090").unwrap()
/// .start(); /// .start();
/// ///
/// //#### # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0)); /// # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
/// }); /// });
/// } /// }
/// ``` /// ```

View File

@ -418,7 +418,7 @@ impl<H: IntoHttpHandler> HttpServer<H> {
/// .bind("127.0.0.1:0") /// .bind("127.0.0.1:0")
/// .expect("Can not bind to 127.0.0.1:0") /// .expect("Can not bind to 127.0.0.1:0")
/// .start(); /// .start();
/// //#### # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0)); /// # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
/// }); /// });
/// } /// }
/// ``` /// ```