From 8dbbb0ee07a1c6f376cbccea05ebf8881cde8505 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 10 Apr 2018 13:31:10 -0700 Subject: [PATCH] update guide --- guide/src/qs_2.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guide/src/qs_2.md b/guide/src/qs_2.md index 8f3ec392..a5f3d277 100644 --- a/guide/src/qs_2.md +++ b/guide/src/qs_2.md @@ -51,10 +51,11 @@ request handler with the application's `resource` on a particular *HTTP method* ``` After that, the application instance can be used with `HttpServer` to listen for incoming -connections. The server accepts a function that should return an `HttpHandler` instance: +connections. The server accepts a function that should return an `HttpHandler` instance. +For simplicity `server::new` could be used, this function is shortcut for `HttpServer::new`: ```rust,ignore - HttpServer::new( + server::new( || App::new() .resource("/", |r| r.f(index))) .bind("127.0.0.1:8088")? @@ -80,7 +81,7 @@ fn main() { # // If copying this example in show-all mode, make sure you skip the thread spawn # // call. # thread::spawn(|| { - server::HttpServer::new( + server::new( || App::new() .resource("/", |r| r.f(index))) .bind("127.0.0.1:8088").expect("Can not bind to 127.0.0.1:8088")