diff --git a/rustfmt.toml b/rustfmt.toml index 6db67ed28..4fff285e7 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,5 +1,5 @@ max_width = 89 reorder_imports = true -wrap_comments = true +#wrap_comments = true fn_args_density = "Compressed" #use_small_heuristics = false diff --git a/src/application.rs b/src/application.rs index ab1548bff..fffa5d839 100644 --- a/src/application.rs +++ b/src/application.rs @@ -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 { diff --git a/src/extractor.rs b/src/extractor.rs index caf34332d..3d77853a5 100644 --- a/src/extractor.rs +++ b/src/extractor.rs @@ -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, /// } diff --git a/src/httpmessage.rs b/src/httpmessage.rs index 49d6a8a75..83994e343 100644 --- a/src/httpmessage.rs +++ b/src/httpmessage.rs @@ -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> { diff --git a/src/httprequest.rs b/src/httprequest.rs index b75bbbe4e..0a14ca043 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -283,9 +283,9 @@ impl HttpRequest { /// 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() diff --git a/src/json.rs b/src/json.rs index 8e5cc293c..d0e12c04d 100644 --- a/src/json.rs +++ b/src/json.rs @@ -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, /// } diff --git a/src/lib.rs b/src/lib.rs index e8876a9c7..6c7659607 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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(); -//! //#### # }); +//! # }); //! } //! ``` //! diff --git a/src/middleware/session.rs b/src/middleware/session.rs index 38be12355..bfc40dd5d 100644 --- a/src/middleware/session.rs +++ b/src/middleware/session.rs @@ -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)); //! }); //! } //! ``` diff --git a/src/resource.rs b/src/resource.rs index df6a05f2f..0920beeb8 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -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() { diff --git a/src/server/mod.rs b/src/server/mod.rs index 44022931b..cdfebab5d 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -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)); /// }); /// } /// ``` diff --git a/src/server/srv.rs b/src/server/srv.rs index ba8c83e65..665babd78 100644 --- a/src/server/srv.rs +++ b/src/server/srv.rs @@ -418,7 +418,7 @@ impl HttpServer { /// .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)); /// }); /// } /// ```