use `actix_rt::block_on` in examples

This commit is contained in:
Ibraheem Ahmed 2022-01-31 21:47:12 -05:00
parent 40a4b1ccd5
commit 10bacd6fc0
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ async fn index(req: HttpRequest) -> &'static str {
fn main() -> std::io::Result<()> { fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
rt::System::new().block_on( rt::block_on(
HttpServer::new(|| { HttpServer::new(|| {
App::new() App::new()
.wrap(middleware::Logger::default()) .wrap(middleware::Logger::default())

View File

@ -13,7 +13,7 @@
//! } //! }
//! //!
//! # fn main() -> std::io::Result<()> { //! # fn main() -> std::io::Result<()> {
//! rt::System::new().block_on( //! rt::block_on(
//! HttpServer::new(|| { //! HttpServer::new(|| {
//! App::new() //! App::new()
//! .wrap(middleware::Logger::default()) //! .wrap(middleware::Logger::default())