From a159a9cd6ecdc51565becf0e40a68ac13b0d4d84 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 9 Jan 2018 10:08:06 -0800 Subject: [PATCH] cleanup doc tests --- README.md | 2 +- guide/src/qs_2.md | 5 ++++- src/lib.rs | 11 +++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dec357a55..5e0f5e025 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Actix web [![Build Status](https://travis-ci.org/actix/actix-web.svg?branch=master)](https://travis-ci.org/actix/actix-web) [![Build status](https://ci.appveyor.com/api/projects/status/kkdb4yce7qhm5w85/branch/master?svg=true)](https://ci.appveyor.com/project/fafhrd91/actix-web-hdy9d/branch/master) [![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web) [![crates.io](http://meritbadge.herokuapp.com/actix-web)](https://crates.io/crates/actix-web) [![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -Actix web is a small, fast, practical, open source rust web framework. +Actix web is a small, fast, pragmatic, open source rust web framework. ```rust,ignore extern crate actix_web; diff --git a/guide/src/qs_2.md b/guide/src/qs_2.md index 3c347ce65..66eb540e0 100644 --- a/guide/src/qs_2.md +++ b/guide/src/qs_2.md @@ -69,7 +69,8 @@ Head over to ``http://localhost:8088/`` to see the results. Here is full source of main.rs file: -```rust,ignore +```rust +# use std::thread; # extern crate actix_web; use actix_web::*; @@ -78,11 +79,13 @@ fn index(req: HttpRequest) -> &'static str { } fn main() { +# thread::spawn(|| { HttpServer::new( || Application::new() .resource("/", |r| r.f(index))) .bind("127.0.0.1:8088").expect("Can not bind to 127.0.0.1:8088") .run(); +# }); } ``` diff --git a/src/lib.rs b/src/lib.rs index 5238a684e..08df8206a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,18 +1,21 @@ -//! Actix web is a small, fast, down-to-earth, open source rust web framework. +//! Actix web is a small, fast, pragmatic, open source rust web framework. //! -//! ```rust,ignore +//! ```rust //! use actix_web::*; +//! # use std::thread; //! //! fn index(req: HttpRequest) -> String { //! format!("Hello {}!", &req.match_info()["name"]) //! } //! //! fn main() { +//! # thread::spawn(|| { //! HttpServer::new( //! || Application::new() //! .resource("/{name}", |r| r.f(index))) -//! .bind("127.0.0.1:8080")? -//! .start() +//! .bind("127.0.0.1:8080").unwrap() +//! .run(); +//! # }); //! } //! ``` //!