From 617bde7e7ab0b35b7e0f91f36a8fc0ed249eb3f2 Mon Sep 17 00:00:00 2001 From: leone Date: Tue, 28 May 2024 18:12:48 +0200 Subject: [PATCH] chore: upgrade to ntex 2.0 (#9) * chore: upgrade to ntex 2.0 * chore: upgrade ntex-extras deps --- examples/application/Cargo.toml | 2 +- examples/async-handlers/Cargo.toml | 2 +- examples/databases/Cargo.toml | 2 +- examples/either/Cargo.toml | 2 +- examples/errors/Cargo.toml | 2 +- examples/extractors/Cargo.toml | 2 +- examples/flexible-responders/Cargo.toml | 2 +- examples/getting-started/Cargo.toml | 2 +- examples/http2/Cargo.toml | 2 +- examples/main-example/Cargo.toml | 2 +- examples/middleware/Cargo.toml | 4 ++-- examples/middleware/src/errorhandler.rs | 2 +- examples/middleware/src/main.rs | 2 +- examples/powerful-extractors/Cargo.toml | 2 +- examples/request-handlers/Cargo.toml | 2 +- examples/request-routing/Cargo.toml | 2 +- examples/requests/Cargo.toml | 2 +- examples/responses/Cargo.toml | 2 +- examples/server/Cargo.toml | 2 +- examples/static-files/Cargo.toml | 4 ++-- examples/testing/Cargo.toml | 2 +- examples/url-dispatch/Cargo.toml | 2 +- examples/websockets/Cargo.toml | 2 +- vars.js | 2 +- 24 files changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/application/Cargo.toml b/examples/application/Cargo.toml index b82519a..2ac7e8e 100644 --- a/examples/application/Cargo.toml +++ b/examples/application/Cargo.toml @@ -5,4 +5,4 @@ edition = "2018" workspace = "../" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } diff --git a/examples/async-handlers/Cargo.toml b/examples/async-handlers/Cargo.toml index 1110303..3d0f15e 100644 --- a/examples/async-handlers/Cargo.toml +++ b/examples/async-handlers/Cargo.toml @@ -4,6 +4,6 @@ version = "2.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } futures = "0.3.1" bytes = "0.5" diff --git a/examples/databases/Cargo.toml b/examples/databases/Cargo.toml index d6b66b1..5c2b682 100644 --- a/examples/databases/Cargo.toml +++ b/examples/databases/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } diesel = { version = "2", features = ["sqlite", "r2d2"] } serde = { version = "1", features = ["derive"] } uuid = { version = "1", features = ["v4"] } diff --git a/examples/either/Cargo.toml b/examples/either/Cargo.toml index 7429d96..377b149 100644 --- a/examples/either/Cargo.toml +++ b/examples/either/Cargo.toml @@ -4,4 +4,4 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } diff --git a/examples/errors/Cargo.toml b/examples/errors/Cargo.toml index 179f461..f26896e 100644 --- a/examples/errors/Cargo.toml +++ b/examples/errors/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } derive_more = "0.99" env_logger = "0.7" log = "0.4" diff --git a/examples/extractors/Cargo.toml b/examples/extractors/Cargo.toml index 418d2af..bd5a031 100644 --- a/examples/extractors/Cargo.toml +++ b/examples/extractors/Cargo.toml @@ -4,6 +4,6 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } serde = "1.0" serde_json = "1.0" diff --git a/examples/flexible-responders/Cargo.toml b/examples/flexible-responders/Cargo.toml index ca767cb..c837b53 100644 --- a/examples/flexible-responders/Cargo.toml +++ b/examples/flexible-responders/Cargo.toml @@ -4,5 +4,5 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } serde = "1.0" diff --git a/examples/getting-started/Cargo.toml b/examples/getting-started/Cargo.toml index b009581..78215b5 100644 --- a/examples/getting-started/Cargo.toml +++ b/examples/getting-started/Cargo.toml @@ -5,4 +5,4 @@ edition = "2018" workspace = "../" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } diff --git a/examples/http2/Cargo.toml b/examples/http2/Cargo.toml index 02c9b93..36a6c5b 100644 --- a/examples/http2/Cargo.toml +++ b/examples/http2/Cargo.toml @@ -4,5 +4,5 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio", "openssl"] } +ntex = { version = "2", features = ["tokio", "openssl"] } openssl = { version = "0.10", features = ["v110", "vendored"] } diff --git a/examples/main-example/Cargo.toml b/examples/main-example/Cargo.toml index 1e7feb1..aa767a0 100644 --- a/examples/main-example/Cargo.toml +++ b/examples/main-example/Cargo.toml @@ -4,4 +4,4 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } diff --git a/examples/middleware/Cargo.toml b/examples/middleware/Cargo.toml index ca2256a..4de4352 100644 --- a/examples/middleware/Cargo.toml +++ b/examples/middleware/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio", "cookie"] } -ntex-session = { version = "1" } +ntex = { version = "2", features = ["tokio", "cookie"] } +ntex-session = { version = "2" } futures-util = { version = "0.3.7", default-features = false, features = ["std"] } env_logger = "0.10.0" diff --git a/examples/middleware/src/errorhandler.rs b/examples/middleware/src/errorhandler.rs index d9df50a..17b958f 100644 --- a/examples/middleware/src/errorhandler.rs +++ b/examples/middleware/src/errorhandler.rs @@ -27,7 +27,7 @@ where type Response = web::WebResponse; type Error = web::Error; - ntex::forward_poll_ready!(service); + ntex::forward_ready!(service); async fn call(&self, req: web::WebRequest, ctx: ServiceCtx<'_, Self>) -> Result { ctx.call(&self.service, req).await.map(|mut res| { diff --git a/examples/middleware/src/main.rs b/examples/middleware/src/main.rs index 6ddd769..adfcc44 100644 --- a/examples/middleware/src/main.rs +++ b/examples/middleware/src/main.rs @@ -33,7 +33,7 @@ where type Response = web::WebResponse; type Error = web::Error; - ntex::forward_poll_ready!(service); + ntex::forward_ready!(service); async fn call(&self, req: web::WebRequest, ctx: ServiceCtx<'_, Self>) -> Result { println!("Hi from start. You requested: {}", req.path()); diff --git a/examples/powerful-extractors/Cargo.toml b/examples/powerful-extractors/Cargo.toml index e7dae0b..b2e274c 100644 --- a/examples/powerful-extractors/Cargo.toml +++ b/examples/powerful-extractors/Cargo.toml @@ -4,5 +4,5 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } serde = "1.0" diff --git a/examples/request-handlers/Cargo.toml b/examples/request-handlers/Cargo.toml index 0bb350e..0911cc0 100644 --- a/examples/request-handlers/Cargo.toml +++ b/examples/request-handlers/Cargo.toml @@ -4,4 +4,4 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } diff --git a/examples/request-routing/Cargo.toml b/examples/request-routing/Cargo.toml index 57c7d41..65098cd 100644 --- a/examples/request-routing/Cargo.toml +++ b/examples/request-routing/Cargo.toml @@ -4,4 +4,4 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } diff --git a/examples/requests/Cargo.toml b/examples/requests/Cargo.toml index 00fbdeb..10a6daa 100644 --- a/examples/requests/Cargo.toml +++ b/examples/requests/Cargo.toml @@ -6,6 +6,6 @@ edition = "2018" [dependencies] serde = "1.0" serde_json = "1.0" -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } futures = "0.3.1" ntex-multipart = "1" diff --git a/examples/responses/Cargo.toml b/examples/responses/Cargo.toml index cb8788b..4bce1f0 100644 --- a/examples/responses/Cargo.toml +++ b/examples/responses/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio", "compress"] } +ntex = { version = "2", features = ["tokio", "compress"] } serde = "1.0" futures = "0.3.1" bytes = "0.5" diff --git a/examples/server/Cargo.toml b/examples/server/Cargo.toml index 042e2cf..ba77190 100644 --- a/examples/server/Cargo.toml +++ b/examples/server/Cargo.toml @@ -5,7 +5,7 @@ workspace = "../" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio", "openssl"] } +ntex = { version = "2", features = ["tokio", "openssl"] } futures = "0.3" openssl = { version = "0.10", features = ["vendored"] } tokio = { version = "1.16.1", features = ["full"] } diff --git a/examples/static-files/Cargo.toml b/examples/static-files/Cargo.toml index 5250036..32284c3 100644 --- a/examples/static-files/Cargo.toml +++ b/examples/static-files/Cargo.toml @@ -4,6 +4,6 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } -ntex-files = "1" +ntex = { version = "2", features = ["tokio"] } +ntex-files = "2" mime = "0.3" diff --git a/examples/testing/Cargo.toml b/examples/testing/Cargo.toml index 96c154d..1efa9cf 100644 --- a/examples/testing/Cargo.toml +++ b/examples/testing/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2018" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } futures = "0.3" futures-util = "0.3" bytes = "0.5" diff --git a/examples/url-dispatch/Cargo.toml b/examples/url-dispatch/Cargo.toml index 11be6b3..d7af835 100644 --- a/examples/url-dispatch/Cargo.toml +++ b/examples/url-dispatch/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" workspace = "../" [dependencies] -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } futures = "0.3.1" openssl = "0.10" serde = "1.0" diff --git a/examples/websockets/Cargo.toml b/examples/websockets/Cargo.toml index 89045c6..af837d0 100644 --- a/examples/websockets/Cargo.toml +++ b/examples/websockets/Cargo.toml @@ -5,4 +5,4 @@ edition = "2018" [dependencies] futures = "0.3.27" -ntex = { version = "1", features = ["tokio"] } +ntex = { version = "2", features = ["tokio"] } diff --git a/vars.js b/vars.js index 1d962cf..de24dbc 100644 --- a/vars.js +++ b/vars.js @@ -1,4 +1,4 @@ module.exports = { rustVersion: '1.75', - ntexMajorVersion: '1.0', + ntexMajorVersion: '2.0', };