Browse Source

ntex: update dependencies (#7669)

* update deps

* use latest image
Nikolay Kim 2 years ago
parent
commit
1a0f5b1596

+ 5 - 6
frameworks/Rust/ntex/Cargo.toml

@@ -37,19 +37,18 @@ tokio = ["ntex/tokio"]
 async-std = ["ntex/async-std"]
 
 [dependencies]
-ntex = "0.5.16"
+ntex = "0.5.28"
 mimalloc = { version = "0.1.25", default-features = false }
-snmalloc-rs = { version = "0.2.26", features = ["1mib", "native-cpu"] }
+snmalloc-rs = { version = "0.3.3", features = ["native-cpu"] }
 yarte = { version = "0.15", features = ["bytes-buf", "json"] }
 env_logger = "0.9"
 nanorand = { version = "0.7", default-features = false, features = ["std", "wyrand"] }
-atoi = "1.0"
+atoi = "2.0"
 num_cpus = "1.13"
 futures = "0.3"
-http = "0.2"
 smallvec = "1.6.1"
-simd-json = "0.4.13"
-simd-json-derive = "0.2.2"
+simd-json = "0.6.0"
+simd-json-derive = "0.6.3"
 serde = { version = "1.0", features = ["derive"] }
 serde_json = "1.0"
 log = { version = "0.4", features = ["release_max_level_off"] }

+ 1 - 1
frameworks/Rust/ntex/ntex-astd.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.61.0
+FROM rust:latest
 
 # Disable simd at jsonescape
 # ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

+ 1 - 1
frameworks/Rust/ntex/ntex-db-astd.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.61.0
+FROM rust:latest
 
 # Disable simd at jsonescape
 # ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

+ 1 - 1
frameworks/Rust/ntex/ntex-db.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.61.0
+FROM rust:latest
 
 # Disable simd at jsonescape
 # ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

+ 1 - 1
frameworks/Rust/ntex/ntex-plt-astd.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.61.0
+FROM rust:latest
 
 # Disable simd at jsonescape
 # ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

+ 1 - 1
frameworks/Rust/ntex/ntex-plt.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.61.0
+FROM rust:latest
 
 # Disable simd at jsonescape
 # ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

+ 1 - 1
frameworks/Rust/ntex/ntex.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.61.0
+FROM rust:latest
 
 # Disable simd at jsonescape
 # ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

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

@@ -6,7 +6,7 @@ use std::{pin::Pin, task::Context, task::Poll};
 
 use futures::future::{ok, Future, FutureExt};
 use ntex::http::header::{CONTENT_TYPE, SERVER};
-use ntex::http::{HttpService, KeepAlive, Request, Response};
+use ntex::http::{HttpService, KeepAlive, Request, Response, StatusCode};
 use ntex::service::{Service, ServiceFactory};
 use ntex::web::{Error, HttpResponse};
 use ntex::{time::Seconds, util::BytesMut, util::PoolId};
@@ -32,14 +32,14 @@ impl Service<Request> for App {
     fn call(&self, req: Request) -> Self::Future {
         match req.path() {
             "/db" => Box::pin(self.0.get_world().map(|body| {
-                let mut res = HttpResponse::with_body(http::StatusCode::OK, body.into());
+                let mut res = HttpResponse::with_body(StatusCode::OK, body.into());
                 res.headers_mut().append(SERVER, utils::HDR_SERVER);
                 res.headers_mut()
                     .append(CONTENT_TYPE, utils::HDR_JSON_CONTENT_TYPE);
                 Ok(res)
             })),
             "/fortunes" => Box::pin(self.0.tell_fortune().map(|body| {
-                let mut res = HttpResponse::with_body(http::StatusCode::OK, body.into());
+                let mut res = HttpResponse::with_body(StatusCode::OK, body.into());
                 res.headers_mut().append(SERVER, utils::HDR_SERVER);
                 res.headers_mut()
                     .append(CONTENT_TYPE, utils::HDR_HTML_CONTENT_TYPE);
@@ -51,7 +51,7 @@ impl Service<Request> for App {
                     .map(|worlds| {
                         let mut body = BytesMut::with_capacity(35 * worlds.len());
                         let _ = simd_json::to_writer(crate::utils::Writer(&mut body), &worlds);
-                        let mut res = HttpResponse::with_body(http::StatusCode::OK, body.into());
+                        let mut res = HttpResponse::with_body(StatusCode::OK, body.into());
                         res.headers_mut().append(SERVER, utils::HDR_SERVER);
                         res.headers_mut()
                             .append(CONTENT_TYPE, utils::HDR_JSON_CONTENT_TYPE);
@@ -64,14 +64,14 @@ impl Service<Request> for App {
                     .map(|worlds| {
                         let mut body = BytesMut::with_capacity(35 * worlds.len());
                         let _ = simd_json::to_writer(crate::utils::Writer(&mut body), &worlds);
-                        let mut res = HttpResponse::with_body(http::StatusCode::OK, body.into());
+                        let mut res = HttpResponse::with_body(StatusCode::OK, body.into());
                         res.headers_mut().append(SERVER, utils::HDR_SERVER);
                         res.headers_mut()
                             .append(CONTENT_TYPE, utils::HDR_JSON_CONTENT_TYPE);
                         Ok(res)
                     }),
             ),
-            _ => Box::pin(ok(Response::new(http::StatusCode::NOT_FOUND))),
+            _ => Box::pin(ok(Response::new(StatusCode::NOT_FOUND))),
         }
     }
 }