Browse Source

Upgrade to ntex-0.7 (#8286)

Nikolay Kim 2 years ago
parent
commit
a16edb9845
2 changed files with 5 additions and 5 deletions
  1. 3 3
      frameworks/Rust/ntex/Cargo.toml
  2. 2 2
      frameworks/Rust/ntex/src/main_db.rs

+ 3 - 3
frameworks/Rust/ntex/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = "ntex"
-version = "0.4.0"
+version = "0.7.0"
 edition = "2018"
 
 [[bin]]
@@ -37,7 +37,7 @@ tokio = ["ntex/tokio"]
 async-std = ["ntex/async-std"]
 
 [dependencies]
-ntex = "0.6.1"
+ntex = "0.7.2"
 ntex-bytes = { version = "0.1.19", features=["simd"] }
 core_affinity = "0.8"
 mimalloc = { version = "0.1.25", default-features = false }
@@ -53,7 +53,7 @@ serde = { version = "1.0", features = ["derive"] }
 serde_json = "1.0"
 log = { version = "0.4", features = ["release_max_level_off"] }
 tok_io = {version = "1", package = "tokio" }
-tokio-postgres = { git="https://github.com/fafhrd91/postgres.git", branch="ntex-0.6" }
+tokio-postgres = { git="https://github.com/fafhrd91/postgres.git" }
 
 [profile.release]
 opt-level = 3

+ 2 - 2
frameworks/Rust/ntex/src/main_db.rs

@@ -7,7 +7,7 @@ use std::sync::{Arc, Mutex};
 
 use ntex::http::header::{CONTENT_TYPE, SERVER};
 use ntex::http::{HttpService, KeepAlive, Request, Response, StatusCode};
-use ntex::service::{Service, ServiceFactory};
+use ntex::service::{Service, ServiceFactory, ServiceCtx};
 use ntex::web::{Error, HttpResponse};
 use ntex::{time::Seconds, util::BoxFuture, util::PoolId};
 
@@ -21,7 +21,7 @@ impl Service<Request> for App {
     type Error = Error;
     type Future<'f> = BoxFuture<'f, Result<Response, Error>> where Self: 'f;
 
-    fn call(&self, req: Request) -> Self::Future<'_> {
+    fn call<'a>(&'a self, req: Request, _: ServiceCtx<'a, Self>) -> Self::Future<'a> {
         Box::pin(async move {
             match req.path() {
                 "/db" => {