diff --git a/examples/basic.rs b/examples/basic.rs index 8a21348dd..ba073db29 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -75,23 +75,20 @@ fn main() { // service for converting incoming TcpStream to a SslStream (move |stream| { - SslAcceptorExt::accept_async(&acceptor, stream) - .map_err(|e| println!("Openssl error: {}", e)) - }) - // convert closure to a `NewService` - .into_new_service() - - // .and_then() combinator uses other service to convert incoming `Request` to a `Response` - // and then uses that response as an input for next service. - // in this case, on success we use `logger` service - .and_then(logger) - - // next service uses two components, service state and service function - // actix-net generates `NewService` impl that creates `ServiceState` instance for each new service - // and use `service` function as `Service::call` - .and_then((service, move || { - Ok(ServiceState { num: num.clone() }) - })) + SslAcceptorExt::accept_async(&acceptor, stream) + .map_err(|e| println!("Openssl error: {}", e)) + }) + // convert closure to a `NewService` + .into_new_service() + // .and_then() combinator uses other service to convert incoming `Request` to a + // `Response` and then uses that response as an input for next + // service. in this case, on success we use `logger` service + .and_then(logger) + // next service uses two components, service state and service function + // actix-net generates `NewService` impl that creates `ServiceState` instance + // for each new service and use `service` function as + // `Service::call` + .and_then((service, move || Ok(ServiceState { num: num.clone() }))) }, ).unwrap() .start(); diff --git a/src/lib.rs b/src/lib.rs index fe27daaea..7443118b8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,6 @@ //! * `tls` - enables ssl support via `native-tls` crate //! * `ssl` - enables ssl support via `openssl` crate //! * `rust-tls` - enables ssl support via `rustls` crate -//! // #![warn(missing_docs)] #![cfg_attr( diff --git a/src/server/server.rs b/src/server/server.rs index a031ad2d7..fb3c6fcd6 100644 --- a/src/server/server.rs +++ b/src/server/server.rs @@ -113,26 +113,6 @@ impl Server { /// /// This function is useful for moving parts of configuration to a /// different module or event library. - /// - /// ```rust - /// # extern crate actix_web; - /// use actix_web::{fs, middleware, App, HttpResponse}; - /// - /// // this function could be located in different module - /// fn config(app: App) -> App { - /// app.resource("/test", |r| { - /// r.get().f(|_| HttpResponse::Ok()); - /// r.head().f(|_| HttpResponse::MethodNotAllowed()); - /// }) - /// } - /// - /// fn main() { - /// let app = App::new() - /// .middleware(middleware::Logger::default()) - /// .configure(config) // <- register resources - /// .handler("/static", fs::StaticFiles::new(".").unwrap()); - /// } - /// ``` pub fn configure(self, cfg: F) -> Server where F: Fn(Server) -> Server,