Skip to content

Commit

Permalink
Fix actix-http examples (actix#1259)
Browse files Browse the repository at this point in the history
Fix actix-http examples
  • Loading branch information
linkmauve authored and JohnTitor committed Jan 6, 2020
1 parent 2803fcb commit f5fd6bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion actix-http/examples/echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use futures::StreamExt;
use http::header::HeaderValue;
use log::info;

fn main() -> io::Result<()> {
#[actix_rt::main]
async fn main() -> io::Result<()> {
env::set_var("RUST_LOG", "echo=info");
env_logger::init();

Expand Down Expand Up @@ -37,4 +38,5 @@ fn main() -> io::Result<()> {
.tcp()
})?
.run()
.await
}
4 changes: 3 additions & 1 deletion actix-http/examples/echo2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ async fn handle_request(mut req: Request) -> Result<Response, Error> {
.body(body))
}

fn main() -> io::Result<()> {
#[actix_rt::main]
async fn main() -> io::Result<()> {
env::set_var("RUST_LOG", "echo=info");
env_logger::init();

Expand All @@ -28,4 +29,5 @@ fn main() -> io::Result<()> {
HttpService::build().finish(handle_request).tcp()
})?
.run()
.await
}
4 changes: 3 additions & 1 deletion actix-http/examples/hello-world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use futures::future;
use http::header::HeaderValue;
use log::info;

fn main() -> io::Result<()> {
#[actix_rt::main]
async fn main() -> io::Result<()> {
env::set_var("RUST_LOG", "hello_world=info");
env_logger::init();

Expand All @@ -24,4 +25,5 @@ fn main() -> io::Result<()> {
.tcp()
})?
.run()
.await
}

0 comments on commit f5fd6bc

Please sign in to comment.