mirror of
https://github.com/actix/actix-web.git
synced 2024-12-19 06:36:36 +00:00
fix rustfmt formatting
This commit is contained in:
parent
3f5a39a5b7
commit
c8930b7b6b
11 changed files with 24 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
max_width = 89
|
||||
reorder_imports = true
|
||||
wrap_comments = true
|
||||
#wrap_comments = true
|
||||
fn_args_density = "Compressed"
|
||||
#use_small_heuristics = false
|
||||
|
|
|
@ -634,7 +634,7 @@ where
|
|||
/// struct State2;
|
||||
///
|
||||
/// fn main() {
|
||||
/// //#### # thread::spawn(|| {
|
||||
/// # thread::spawn(|| {
|
||||
/// server::new(|| {
|
||||
/// vec![
|
||||
/// App::with_state(State1)
|
||||
|
@ -649,7 +649,7 @@ where
|
|||
/// }).bind("127.0.0.1:8080")
|
||||
/// .unwrap()
|
||||
/// .run()
|
||||
/// //#### # });
|
||||
/// # });
|
||||
/// }
|
||||
/// ```
|
||||
pub fn boxed(mut self) -> Box<HttpHandler> {
|
||||
|
|
|
@ -120,13 +120,13 @@ where
|
|||
/// ## Example
|
||||
///
|
||||
/// ```rust
|
||||
/// //#### # extern crate bytes;
|
||||
/// //#### # extern crate actix_web;
|
||||
/// //#### # extern crate futures;
|
||||
/// //#### #[macro_use] extern crate serde_derive;
|
||||
/// # extern crate bytes;
|
||||
/// # extern crate actix_web;
|
||||
/// # extern crate futures;
|
||||
/// #[macro_use] extern crate serde_derive;
|
||||
/// use actix_web::{App, Query, http};
|
||||
///
|
||||
/// //#### #[derive(Deserialize)]
|
||||
/// #[derive(Deserialize)]
|
||||
/// struct Info {
|
||||
/// username: String,
|
||||
/// }
|
||||
|
|
|
@ -231,7 +231,7 @@ pub trait HttpMessage {
|
|||
/// # extern crate futures;
|
||||
/// # use std::str;
|
||||
/// # use actix_web::*;
|
||||
/// # use actix_web::actix::*;
|
||||
/// # use actix_web::actix::fut::FinishStream;
|
||||
/// # use futures::{Future, Stream};
|
||||
/// # use futures::future::{ok, result, Either};
|
||||
/// fn index(mut req: HttpRequest) -> Box<Future<Item = HttpResponse, Error = Error>> {
|
||||
|
|
|
@ -283,9 +283,9 @@ impl<S> HttpRequest<S> {
|
|||
/// Generate url for named resource
|
||||
///
|
||||
/// ```rust
|
||||
/// //#### # extern crate actix_web;
|
||||
/// //#### # use actix_web::{App, HttpRequest, HttpResponse, http};
|
||||
/// //#### #
|
||||
/// # extern crate actix_web;
|
||||
/// # use actix_web::{App, HttpRequest, HttpResponse, http};
|
||||
/// #
|
||||
/// fn index(req: HttpRequest) -> HttpResponse {
|
||||
/// let url = req.url_for("foo", &["1", "2", "3"]); // <- generate url for "foo" resource
|
||||
/// HttpResponse::Ok().into()
|
||||
|
|
|
@ -32,11 +32,11 @@ use httpresponse::HttpResponse;
|
|||
/// ## Example
|
||||
///
|
||||
/// ```rust
|
||||
/// //#### # extern crate actix_web;
|
||||
/// //#### #[macro_use] extern crate serde_derive;
|
||||
/// # extern crate actix_web;
|
||||
/// #[macro_use] extern crate serde_derive;
|
||||
/// use actix_web::{App, Json, Result, http};
|
||||
///
|
||||
/// //#### #[derive(Deserialize)]
|
||||
/// #[derive(Deserialize)]
|
||||
/// struct Info {
|
||||
/// username: String,
|
||||
/// }
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
//! }
|
||||
//!
|
||||
//! fn main() {
|
||||
//! //#### # thread::spawn(|| {
|
||||
//! # thread::spawn(|| {
|
||||
//! server::new(|| {
|
||||
//! App::new().resource("/{name}/{id}/index.html", |r| r.with(index))
|
||||
//! }).bind("127.0.0.1:8080")
|
||||
//! .unwrap()
|
||||
//! .run();
|
||||
//! //#### # });
|
||||
//! # });
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
//! session data.
|
||||
//!
|
||||
//! ```rust
|
||||
//! //#### # extern crate actix_web;
|
||||
//! use actix_web::{server, App, HttpRequest, Result};
|
||||
//! # extern crate actix_web;
|
||||
//! use actix_web::{actix, server, App, HttpRequest, Result};
|
||||
//! use actix_web::middleware::session::{RequestSession, SessionStorage, CookieSessionBackend};
|
||||
//!
|
||||
//! fn index(req: HttpRequest) -> Result<&'static str> {
|
||||
|
@ -58,7 +58,7 @@
|
|||
//! )))
|
||||
//! .bind("127.0.0.1:59880").unwrap()
|
||||
//! .start();
|
||||
//! //#### # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||
//! # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||
//! });
|
||||
//! }
|
||||
//! ```
|
||||
|
|
|
@ -24,7 +24,7 @@ use route::Route;
|
|||
/// predicates route route considered matched and route handler get called.
|
||||
///
|
||||
/// ```rust
|
||||
/// //#### # extern crate actix_web;
|
||||
/// # extern crate actix_web;
|
||||
/// use actix_web::{App, HttpResponse, http};
|
||||
///
|
||||
/// fn main() {
|
||||
|
|
|
@ -42,7 +42,7 @@ pub(crate) const MAX_WRITE_BUFFER_SIZE: usize = 65_536;
|
|||
/// This is shortcut for `server::HttpServer::new()` method.
|
||||
///
|
||||
/// ```rust
|
||||
/// //#### # extern crate actix_web;
|
||||
/// # extern crate actix_web;
|
||||
/// use actix_web::{actix, server, App, HttpResponse};
|
||||
///
|
||||
/// fn main() {
|
||||
|
@ -54,7 +54,7 @@ pub(crate) const MAX_WRITE_BUFFER_SIZE: usize = 65_536;
|
|||
/// .bind("127.0.0.1:59090").unwrap()
|
||||
/// .start();
|
||||
///
|
||||
/// //#### # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||
/// # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||
/// });
|
||||
/// }
|
||||
/// ```
|
||||
|
|
|
@ -418,7 +418,7 @@ impl<H: IntoHttpHandler> HttpServer<H> {
|
|||
/// .bind("127.0.0.1:0")
|
||||
/// .expect("Can not bind to 127.0.0.1:0")
|
||||
/// .start();
|
||||
/// //#### # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||
/// # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||
/// });
|
||||
/// }
|
||||
/// ```
|
||||
|
|
Loading…
Reference in a new issue