From dc74db1f2f6a0686410633531960807836bb38b6 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 18 Jun 2020 15:45:30 +0100 Subject: [PATCH] re-export actix_rt::main macro (#1559) --- CHANGES.md | 4 ++++ Cargo.toml | 2 +- README.md | 3 +-- examples/basic.rs | 2 +- examples/client.rs | 2 +- examples/uds.rs | 2 +- src/lib.rs | 1 + 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3c21c301..c2dd4397 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Added + +* Re-export `actix_rt::main` as `actix_web::main`. + ### Changed * Fix actix_http::h1::dispatcher so it returns when HW_BUFFER_SIZE is reached. Should reduce peak memory consumption during large uploads. [#1550] diff --git a/Cargo.toml b/Cargo.toml index 8c6d461d..ade432c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,7 @@ actix-codec = "0.2.0" actix-service = "1.0.2" actix-utils = "1.0.6" actix-router = "0.2.4" -actix-rt = "1.0.0" +actix-rt = "1.1.1" actix-server = "1.0.0" actix-testing = "1.0.0" actix-macros = "0.1.0" diff --git a/README.md b/README.md index 97e3ceea..6382abd4 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,6 @@ Dependencies: ```toml [dependencies] actix-web = "2" -actix-rt = "1" ``` Code: @@ -66,7 +65,7 @@ async fn index(info: web::Path<(u32, String)>) -> impl Responder { format!("Hello {}! id:{}", info.1, info.0) } -#[actix_rt::main] +#[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| App::new().service(index)) .bind("127.0.0.1:8080")? diff --git a/examples/basic.rs b/examples/basic.rs index bd6f8146..8b2bf231 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -16,7 +16,7 @@ async fn no_params() -> &'static str { "Hello world!\r\n" } -#[actix_rt::main] +#[actix_web::main] async fn main() -> std::io::Result<()> { std::env::set_var("RUST_LOG", "actix_server=info,actix_web=info"); env_logger::init(); diff --git a/examples/client.rs b/examples/client.rs index 874e08e1..15cf24fa 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -1,6 +1,6 @@ use actix_http::Error; -#[actix_rt::main] +#[actix_web::main] async fn main() -> Result<(), Error> { std::env::set_var("RUST_LOG", "actix_http=trace"); env_logger::init(); diff --git a/examples/uds.rs b/examples/uds.rs index 06aa87f4..e34fa5ac 100644 --- a/examples/uds.rs +++ b/examples/uds.rs @@ -20,7 +20,7 @@ async fn no_params() -> &'static str { } #[cfg(unix)] -#[actix_rt::main] +#[actix_web::main] async fn main() -> std::io::Result<()> { std::env::set_var("RUST_LOG", "actix_server=info,actix_web=info"); env_logger::init(); diff --git a/src/lib.rs b/src/lib.rs index cff4acf2..09642806 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -112,6 +112,7 @@ pub use actix_web_codegen::*; // re-export for convenience pub use actix_http::Response as HttpResponse; pub use actix_http::{body, cookie, http, Error, HttpMessage, ResponseError, Result}; +pub use actix_macros::{main, test as test_rt}; pub use crate::app::App; pub use crate::extract::FromRequest;