mirror of https://github.com/fafhrd91/actix-web
				
				
				
			cleanup doc tests
This commit is contained in:
		
							parent
							
								
									c7798ef45d
								
							
						
					
					
						commit
						a159a9cd6e
					
				|  | @ -1,6 +1,6 @@ | ||||||
| # Actix web [](https://travis-ci.org/actix/actix-web) [](https://ci.appveyor.com/project/fafhrd91/actix-web-hdy9d/branch/master) [](https://codecov.io/gh/actix/actix-web) [](https://crates.io/crates/actix-web) [](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | # Actix web [](https://travis-ci.org/actix/actix-web) [](https://ci.appveyor.com/project/fafhrd91/actix-web-hdy9d/branch/master) [](https://codecov.io/gh/actix/actix-web) [](https://crates.io/crates/actix-web) [](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 | ```rust,ignore | ||||||
| extern crate actix_web; | extern crate actix_web; | ||||||
|  |  | ||||||
|  | @ -69,7 +69,8 @@ Head over to ``http://localhost:8088/`` to see the results. | ||||||
| 
 | 
 | ||||||
| Here is full source of main.rs file: | Here is full source of main.rs file: | ||||||
| 
 | 
 | ||||||
| ```rust,ignore | ```rust | ||||||
|  | # use std::thread; | ||||||
| # extern crate actix_web; | # extern crate actix_web; | ||||||
| use actix_web::*; | use actix_web::*; | ||||||
| 
 | 
 | ||||||
|  | @ -78,11 +79,13 @@ fn index(req: HttpRequest) -> &'static str { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| fn main() { | fn main() { | ||||||
|  | # thread::spawn(|| { | ||||||
|     HttpServer::new( |     HttpServer::new( | ||||||
|         || Application::new() |         || Application::new() | ||||||
|             .resource("/", |r| r.f(index))) |             .resource("/", |r| r.f(index))) | ||||||
|         .bind("127.0.0.1:8088").expect("Can not bind to 127.0.0.1:8088") |         .bind("127.0.0.1:8088").expect("Can not bind to 127.0.0.1:8088") | ||||||
|         .run(); |         .run(); | ||||||
|  | # }); | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										11
									
								
								src/lib.rs
								
								
								
								
							
							
						
						
									
										11
									
								
								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 actix_web::*;
 | ||||||
|  | //! # use std::thread;
 | ||||||
| //!
 | //!
 | ||||||
| //! fn index(req: HttpRequest) -> String {
 | //! fn index(req: HttpRequest) -> String {
 | ||||||
| //!     format!("Hello {}!", &req.match_info()["name"])
 | //!     format!("Hello {}!", &req.match_info()["name"])
 | ||||||
| //! }
 | //! }
 | ||||||
| //!
 | //!
 | ||||||
| //! fn main() {
 | //! fn main() {
 | ||||||
|  | //! # thread::spawn(|| {
 | ||||||
| //!     HttpServer::new(
 | //!     HttpServer::new(
 | ||||||
| //!         || Application::new()
 | //!         || Application::new()
 | ||||||
| //!             .resource("/{name}", |r| r.f(index)))
 | //!             .resource("/{name}", |r| r.f(index)))
 | ||||||
| //!         .bind("127.0.0.1:8080")?
 | //!         .bind("127.0.0.1:8080").unwrap()
 | ||||||
| //!         .start()
 | //!         .run();
 | ||||||
|  | //! # });
 | ||||||
| //! }
 | //! }
 | ||||||
| //! ```
 | //! ```
 | ||||||
| //!
 | //!
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue