From 5b11a3e30eca2cf8e0537ddc91ea501bff2ec397 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 15 Jan 2025 18:27:00 +0500 Subject: [PATCH] Clippy fixes (#503) --- ntex-router/src/lib.rs | 7 +------ ntex-router/src/quoter.rs | 2 +- ntex-util/src/future/mod.rs | 2 +- ntex/src/http/h1/service.rs | 2 +- ntex/src/http/h2/service.rs | 2 +- ntex/src/http/service.rs | 2 +- ntex/src/http/test.rs | 2 +- ntex/src/web/test.rs | 10 +++++----- 8 files changed, 12 insertions(+), 17 deletions(-) diff --git a/ntex-router/src/lib.rs b/ntex-router/src/lib.rs index 6d205faa..006b4063 100644 --- a/ntex-router/src/lib.rs +++ b/ntex-router/src/lib.rs @@ -1,9 +1,4 @@ -#![deny( - rust_2018_idioms, - warnings, - unreachable_pub, - missing_debug_implementations -)] +#![deny(warnings, unreachable_pub, missing_debug_implementations)] #![warn(nonstandard_style, future_incompatible)] //! Resource path matching library. diff --git a/ntex-router/src/quoter.rs b/ntex-router/src/quoter.rs index f619ea37..11593c3a 100644 --- a/ntex-router/src/quoter.rs +++ b/ntex-router/src/quoter.rs @@ -63,5 +63,5 @@ fn from_hex(v: u8) -> Option { #[inline] fn restore_ch(d1: u8, d2: u8) -> Option { - from_hex(d1).and_then(|d1| from_hex(d2).map(move |d2| d1 << 4 | d2)) + from_hex(d1).and_then(|d1| from_hex(d2).map(move |d2| (d1 << 4) | d2)) } diff --git a/ntex-util/src/future/mod.rs b/ntex-util/src/future/mod.rs index b510614d..d92637ae 100644 --- a/ntex-util/src/future/mod.rs +++ b/ntex-util/src/future/mod.rs @@ -14,7 +14,7 @@ mod select; pub use self::either::Either; pub use self::join::{join, join_all}; pub use self::lazy::{lazy, Lazy}; -pub use self::on_drop::{OnDropFn, OnDropFutureExt}; +pub use self::on_drop::{OnDropFn, OnDropFuture, OnDropFutureExt}; pub use self::ready::Ready; pub use self::select::select; diff --git a/ntex/src/http/h1/service.rs b/ntex/src/http/h1/service.rs index 63c3b85b..62c4b70f 100644 --- a/ntex/src/http/h1/service.rs +++ b/ntex/src/http/h1/service.rs @@ -290,7 +290,7 @@ where let mut inflight = self.inflight.borrow_mut(); inflight.remove(&ioref); - if inflight.len() == 0 { + if inflight.is_empty() { if let Some(tx) = self.tx.take() { let _ = tx.send(()); } diff --git a/ntex/src/http/h2/service.rs b/ntex/src/http/h2/service.rs index 8c32e3f4..06fb0986 100644 --- a/ntex/src/http/h2/service.rs +++ b/ntex/src/http/h2/service.rs @@ -286,7 +286,7 @@ where let mut inflight = self.inflight.borrow_mut(); inflight.remove(&ioref); - if inflight.len() == 0 { + if inflight.is_empty() { if let Some(tx) = self.tx.take() { let _ = tx.send(()); } diff --git a/ntex/src/http/service.rs b/ntex/src/http/service.rs index 0e3305ad..6174146c 100644 --- a/ntex/src/http/service.rs +++ b/ntex/src/http/service.rs @@ -387,7 +387,7 @@ where let mut inflight = self.inflight.borrow_mut(); inflight.remove(&ioref); - if inflight.len() == 0 { + if inflight.is_empty() { if let Some(tx) = self.tx.take() { let _ = tx.send(()); } diff --git a/ntex/src/http/test.rs b/ntex/src/http/test.rs index 6d9d30d1..a64df994 100644 --- a/ntex/src/http/test.rs +++ b/ntex/src/http/test.rs @@ -257,7 +257,7 @@ where server, client: Client::build().finish(), } - .set_client_timeout(Seconds(60), Millis(60_000)) + .set_client_timeout(Seconds(90), Millis(90_000)) } #[derive(Debug)] diff --git a/ntex/src/web/test.rs b/ntex/src/web/test.rs index 23eb1c88..6a0bcabc 100644 --- a/ntex/src/web/test.rs +++ b/ntex/src/web/test.rs @@ -718,7 +718,7 @@ where Connector::default() .lifetime(Seconds::ZERO) .keep_alive(Seconds(60)) - .timeout(Millis(60_000)) + .timeout(Millis(90_000)) .disconnect_timeout(Seconds(5)) .openssl(builder.build()) .finish() @@ -727,14 +727,14 @@ where { Connector::default() .lifetime(Seconds::ZERO) - .timeout(Millis(60_000)) + .timeout(Millis(90_000)) .finish() } }; Client::build() .connector(connector) - .timeout(Seconds(60)) + .timeout(Seconds(90)) .finish() }; @@ -929,7 +929,7 @@ impl TestServer { WsClient::build(self.url(path)) .address(self.addr) - .timeout(Seconds(30)) + .timeout(Seconds(60)) .openssl(builder.build()) .take() .finish() @@ -945,7 +945,7 @@ impl TestServer { } else { WsClient::build(self.url(path)) .address(self.addr) - .timeout(Seconds(30)) + .timeout(Seconds(60)) .finish() .unwrap() .connect()