Skip to content

Commit

Permalink
re-export actix_rt::main macro
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jun 17, 2020
1 parent e72ee28 commit 5bcc550
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Dependencies:
```toml
[dependencies]
actix-web = "2"
actix-rt = "1"
```

Code:
Expand All @@ -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")?
Expand Down
2 changes: 1 addition & 1 deletion examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/client.rs
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/uds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5bcc550

Please sign in to comment.