mirror of
https://github.com/actix/actix-web.git
synced 2024-11-21 17:11:08 +00:00
chore: move deny lints to manifests
This commit is contained in:
parent
b01fbddba4
commit
e0e4d1e661
42 changed files with 95 additions and 71 deletions
|
@ -51,3 +51,11 @@ awc = { path = "awc" }
|
|||
# actix-utils = { path = "../actix-net/actix-utils" }
|
||||
# actix-tls = { path = "../actix-net/actix-tls" }
|
||||
# actix-server = { path = "../actix-net/actix-server" }
|
||||
|
||||
[workspace.lints.rust]
|
||||
rust_2018_idioms = { level = "deny" }
|
||||
future_incompatible = { level = "deny" }
|
||||
nonstandard_style = { level = "deny" }
|
||||
|
||||
[workspace.lints.clippy]
|
||||
# clone_on_ref_ptr = { level = "deny" }
|
||||
|
|
|
@ -54,3 +54,6 @@ actix-test = "0.1"
|
|||
actix-web = "4"
|
||||
env_logger = "0.11"
|
||||
tempfile = "3.2"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
//! .service(Files::new("/static", ".").prefer_utf8(true));
|
||||
//! ```
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible, missing_docs, missing_debug_implementations)]
|
||||
#![warn(missing_docs, missing_debug_implementations)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -59,3 +59,6 @@ tokio = { version = "1.24.2", features = ["sync"] }
|
|||
|
||||
[dev-dependencies]
|
||||
actix-http = "3"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Various helpers for Actix applications to use during testing.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -167,6 +167,9 @@ tls-openssl = { package = "openssl", version = "0.10.55" }
|
|||
tls-rustls_023 = { package = "rustls", version = "0.23" }
|
||||
tokio = { version = "1.24.2", features = ["net", "rt", "macros"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[[example]]
|
||||
name = "ws"
|
||||
required-features = ["ws", "rustls-0_23"]
|
||||
|
|
|
@ -541,6 +541,6 @@ where
|
|||
|
||||
fn call(&self, (io, addr): (T, Option<net::SocketAddr>)) -> Self::Future {
|
||||
let conn_data = OnConnectData::from_io(&io, self.on_connect_ext.as_deref());
|
||||
Dispatcher::new(io, self.flow.clone(), self.cfg.clone(), addr, conn_data)
|
||||
Dispatcher::new(io, Rc::clone(&self.flow), self.cfg.clone(), addr, conn_data)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -434,7 +434,7 @@ where
|
|||
|
||||
H2ServiceHandlerResponse {
|
||||
state: State::Handshake(
|
||||
Some(self.flow.clone()),
|
||||
Some(Rc::clone(&self.flow)),
|
||||
Some(self.cfg.clone()),
|
||||
addr,
|
||||
on_connect_data,
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
//! [rustls]: https://crates.io/crates/rustls
|
||||
//! [trust-dns]: https://crates.io/crates/trust-dns
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![allow(
|
||||
clippy::type_complexity,
|
||||
clippy::too_many_arguments,
|
||||
|
|
|
@ -66,7 +66,7 @@ impl<T: Head> ops::DerefMut for Message<T> {
|
|||
|
||||
impl<T: Head> Drop for Message<T> {
|
||||
fn drop(&mut self) {
|
||||
T::with_pool(|p| p.release(self.head.clone()))
|
||||
T::with_pool(|p| p.release(Rc::clone(&self.head)))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -910,7 +910,7 @@ where
|
|||
handshake: Some((
|
||||
crate::h2::handshake_with_timeout(io, &self.cfg),
|
||||
self.cfg.clone(),
|
||||
self.flow.clone(),
|
||||
Rc::clone(&self.flow),
|
||||
conn_data,
|
||||
peer_addr,
|
||||
)),
|
||||
|
@ -926,7 +926,7 @@ where
|
|||
state: State::H1 {
|
||||
dispatcher: h1::Dispatcher::new(
|
||||
io,
|
||||
self.flow.clone(),
|
||||
Rc::clone(&self.flow),
|
||||
self.cfg.clone(),
|
||||
peer_addr,
|
||||
conn_data,
|
||||
|
|
|
@ -159,8 +159,8 @@ impl TestBuffer {
|
|||
#[allow(dead_code)]
|
||||
pub(crate) fn clone(&self) -> Self {
|
||||
Self {
|
||||
read_buf: self.read_buf.clone(),
|
||||
write_buf: self.write_buf.clone(),
|
||||
read_buf: Rc::clone(&self.read_buf),
|
||||
write_buf: Rc::clone(&self.write_buf),
|
||||
err: self.err.clone(),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,3 +29,6 @@ actix-multipart = "0.7"
|
|||
actix-web = "4"
|
||||
rustversion = "1"
|
||||
trybuild = "1"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
//!
|
||||
//! See [`macro@MultipartForm`] for usage examples.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -71,7 +71,5 @@ multer = "3"
|
|||
tokio = { version = "1.24.2", features = ["sync"] }
|
||||
tokio-stream = "0.1"
|
||||
|
||||
[lints.rust]
|
||||
future_incompatible = { level = "deny" }
|
||||
rust_2018_idioms = { level = "deny" }
|
||||
nonstandard_style = { level = "deny" }
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -38,6 +38,9 @@ http = "0.2.7"
|
|||
serde = { version = "1", features = ["derive"] }
|
||||
percent-encoding = "2.1"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[[bench]]
|
||||
name = "router"
|
||||
harness = false
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Resource path matching and router.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -73,3 +73,6 @@ tls-rustls-0_21 = { package = "rustls", version = "0.21", optional = true }
|
|||
tls-rustls-0_22 = { package = "rustls", version = "0.22", optional = true }
|
||||
tls-rustls-0_23 = { package = "rustls", version = "0.23", default-features = false, optional = true }
|
||||
tokio = { version = "1.24.2", features = ["sync"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
//! }
|
||||
//! ```
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -41,3 +41,6 @@ actix-web = { version = "4", features = ["macros"] }
|
|||
env_logger = "0.11"
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
|
||||
mime = "0.3"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -55,8 +55,6 @@
|
|||
//! * [`HttpContext`]: This struct provides actor support for streaming HTTP responses.
|
||||
//!
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -35,3 +35,6 @@ actix-web = "4"
|
|||
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||
trybuild = "1"
|
||||
rustversion = "1"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -73,8 +73,6 @@
|
|||
//! [DELETE]: macro@delete
|
||||
|
||||
#![recursion_limit = "512"]
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -145,7 +145,7 @@ async fn custom_resource_name_test<'a>(req: HttpRequest) -> impl Responder {
|
|||
mod guard_module {
|
||||
use actix_web::{guard::GuardContext, http::header};
|
||||
|
||||
pub fn guard(ctx: &GuardContext) -> bool {
|
||||
pub fn guard(ctx: &GuardContext<'_>) -> bool {
|
||||
ctx.header::<header::Accept>()
|
||||
.map(|h| h.preference() == "image/*")
|
||||
.unwrap_or(false)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use actix_web::{guard::GuardContext, http, http::header, web, App, HttpResponse, Responder};
|
||||
use actix_web_codegen::{delete, get, post, route, routes, scope};
|
||||
|
||||
pub fn image_guard(ctx: &GuardContext) -> bool {
|
||||
pub fn image_guard(ctx: &GuardContext<'_>) -> bool {
|
||||
ctx.header::<header::Accept>()
|
||||
.map(|h| h.preference() == "image/*")
|
||||
.unwrap_or(false)
|
||||
|
|
|
@ -188,6 +188,9 @@ tls-rustls = { package = "rustls", version = "0.23" }
|
|||
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
|
||||
zstd = "0.13"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[[test]]
|
||||
name = "test_server"
|
||||
required-features = ["compress-brotli", "compress-gzip", "compress-zstd", "cookies"]
|
||||
|
|
|
@ -39,7 +39,7 @@ impl App<AppEntry> {
|
|||
let factory_ref = Rc::new(RefCell::new(None));
|
||||
|
||||
App {
|
||||
endpoint: AppEntry::new(factory_ref.clone()),
|
||||
endpoint: AppEntry::new(Rc::clone(&factory_ref)),
|
||||
data_factories: Vec::new(),
|
||||
services: Vec::new(),
|
||||
default: None,
|
||||
|
|
|
@ -71,7 +71,7 @@ where
|
|||
});
|
||||
|
||||
// create App config to pass to child services
|
||||
let mut config = AppService::new(config, default.clone());
|
||||
let mut config = AppService::new(config, Rc::clone(&default));
|
||||
|
||||
// register services
|
||||
mem::take(&mut *self.services.borrow_mut())
|
||||
|
|
|
@ -68,7 +68,7 @@ impl AppService {
|
|||
pub(crate) fn clone_config(&self) -> Self {
|
||||
AppService {
|
||||
config: self.config.clone(),
|
||||
default: self.default.clone(),
|
||||
default: Rc::clone(&self.default),
|
||||
services: Vec::new(),
|
||||
root: false,
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ impl AppService {
|
|||
|
||||
/// Returns default handler factory.
|
||||
pub fn default_service(&self) -> Rc<BoxedHttpServiceFactory> {
|
||||
self.default.clone()
|
||||
Rc::clone(&self.default)
|
||||
}
|
||||
|
||||
/// Register HTTP service.
|
||||
|
|
|
@ -184,7 +184,7 @@ impl<T: ?Sized + 'static> FromRequest for Data<T> {
|
|||
|
||||
impl<T: ?Sized + 'static> DataFactory for Data<T> {
|
||||
fn create(&self, extensions: &mut Extensions) -> bool {
|
||||
extensions.insert(Data(self.0.clone()));
|
||||
extensions.insert(Data(Arc::clone(&self.0)));
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,8 +70,6 @@
|
|||
//! - `rustls-0_23` - HTTPS support via `rustls` 0.23 crate, supports `HTTP/2`
|
||||
//! - `secure-cookies` - secure cookies support
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -141,7 +141,7 @@ where
|
|||
actix_service::forward_ready!(service);
|
||||
|
||||
fn call(&self, req: ServiceRequest) -> Self::Future {
|
||||
let inner = self.inner.clone();
|
||||
let inner = Rc::clone(&self.inner);
|
||||
let fut = self.service.call(req);
|
||||
|
||||
DefaultHeaderFuture {
|
||||
|
|
|
@ -220,16 +220,20 @@ impl<B> ErrorHandlers<B> {
|
|||
/// [`.handler()`][ErrorHandlers::handler]) will fall back on this.
|
||||
///
|
||||
/// Note that this will overwrite any default handlers previously set by calling
|
||||
/// [`.default_handler_client()`][ErrorHandlers::default_handler_client] or
|
||||
/// [`.default_handler_server()`][ErrorHandlers::default_handler_server], but not any set by
|
||||
/// calling [`.handler()`][ErrorHandlers::handler].
|
||||
/// [`default_handler_client()`] or [`.default_handler_server()`], but not any set by calling
|
||||
/// [`.handler()`].
|
||||
///
|
||||
/// [`default_handler_client()`]: ErrorHandlers::default_handler_client
|
||||
/// [`.default_handler_server()`]: ErrorHandlers::default_handler_server
|
||||
/// [`.handler()`]: ErrorHandlers::handler
|
||||
pub fn default_handler<F>(self, handler: F) -> Self
|
||||
where
|
||||
F: Fn(ServiceResponse<B>) -> Result<ErrorHandlerResponse<B>> + 'static,
|
||||
{
|
||||
let handler = Rc::new(handler);
|
||||
let handler2 = Rc::clone(&handler);
|
||||
Self {
|
||||
default_server: Some(handler.clone()),
|
||||
default_server: Some(handler2),
|
||||
default_client: Some(handler),
|
||||
..self
|
||||
}
|
||||
|
@ -288,7 +292,7 @@ where
|
|||
type Future = LocalBoxFuture<'static, Result<Self::Transform, Self::InitError>>;
|
||||
|
||||
fn new_transform(&self, service: S) -> Self::Future {
|
||||
let handlers = self.handlers.clone();
|
||||
let handlers = Rc::clone(&self.handlers);
|
||||
let default_client = self.default_client.clone();
|
||||
let default_server = self.default_server.clone();
|
||||
Box::pin(async move {
|
||||
|
@ -323,7 +327,7 @@ where
|
|||
actix_service::forward_ready!(service);
|
||||
|
||||
fn call(&self, req: ServiceRequest) -> Self::Future {
|
||||
let handlers = self.handlers.clone();
|
||||
let handlers = Rc::clone(&self.handlers);
|
||||
let default_client = self.default_client.clone();
|
||||
let default_server = self.default_server.clone();
|
||||
let fut = self.service.call(req);
|
||||
|
|
|
@ -276,7 +276,7 @@ where
|
|||
|
||||
ready(Ok(LoggerMiddleware {
|
||||
service,
|
||||
inner: self.0.clone(),
|
||||
inner: Rc::clone(&self.0),
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,14 +62,14 @@ pub struct Resource<T = ResourceEndpoint> {
|
|||
impl Resource {
|
||||
/// Constructs new resource that matches a `path` pattern.
|
||||
pub fn new<T: IntoPatterns>(path: T) -> Resource {
|
||||
let fref = Rc::new(RefCell::new(None));
|
||||
let factory_ref = Rc::new(RefCell::new(None));
|
||||
|
||||
Resource {
|
||||
routes: Vec::new(),
|
||||
rdef: path.patterns(),
|
||||
name: None,
|
||||
endpoint: ResourceEndpoint::new(fref.clone()),
|
||||
factory_ref: fref,
|
||||
endpoint: ResourceEndpoint::new(Rc::clone(&factory_ref)),
|
||||
factory_ref,
|
||||
guards: Vec::new(),
|
||||
app_data: None,
|
||||
default: boxed::factory(fn_service(|req: ServiceRequest| async {
|
||||
|
|
|
@ -77,7 +77,7 @@ impl ServiceFactory<ServiceRequest> for Route {
|
|||
|
||||
fn new_service(&self, _: ()) -> Self::Future {
|
||||
let fut = self.service.new_service(());
|
||||
let guards = self.guards.clone();
|
||||
let guards = Rc::clone(&self.guards);
|
||||
|
||||
Box::pin(async move {
|
||||
let service = fut.await?;
|
||||
|
|
|
@ -510,7 +510,7 @@ where
|
|||
/// No changes are made to `lst`'s configuration. Ensure it is configured properly before
|
||||
/// passing ownership to `listen()`.
|
||||
pub fn listen(mut self, lst: net::TcpListener) -> io::Result<Self> {
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let factory = self.factory.clone();
|
||||
let addr = lst.local_addr().unwrap();
|
||||
|
||||
|
@ -554,7 +554,7 @@ where
|
|||
/// Binds to existing listener for accepting incoming plaintext HTTP/1.x or HTTP/2 connections.
|
||||
#[cfg(feature = "http2")]
|
||||
pub fn listen_auto_h2c(mut self, lst: net::TcpListener) -> io::Result<Self> {
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let factory = self.factory.clone();
|
||||
let addr = lst.local_addr().unwrap();
|
||||
|
||||
|
@ -632,7 +632,7 @@ where
|
|||
config: actix_tls::accept::rustls_0_20::reexports::ServerConfig,
|
||||
) -> io::Result<Self> {
|
||||
let factory = self.factory.clone();
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let addr = lst.local_addr().unwrap();
|
||||
self.sockets.push(Socket {
|
||||
addr,
|
||||
|
@ -683,7 +683,7 @@ where
|
|||
config: actix_tls::accept::rustls_0_21::reexports::ServerConfig,
|
||||
) -> io::Result<Self> {
|
||||
let factory = self.factory.clone();
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let addr = lst.local_addr().unwrap();
|
||||
self.sockets.push(Socket {
|
||||
addr,
|
||||
|
@ -749,7 +749,7 @@ where
|
|||
config: actix_tls::accept::rustls_0_22::reexports::ServerConfig,
|
||||
) -> io::Result<Self> {
|
||||
let factory = self.factory.clone();
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let addr = lst.local_addr().unwrap();
|
||||
self.sockets.push(Socket {
|
||||
addr,
|
||||
|
@ -815,7 +815,7 @@ where
|
|||
config: actix_tls::accept::rustls_0_23::reexports::ServerConfig,
|
||||
) -> io::Result<Self> {
|
||||
let factory = self.factory.clone();
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let addr = lst.local_addr().unwrap();
|
||||
self.sockets.push(Socket {
|
||||
addr,
|
||||
|
@ -880,7 +880,7 @@ where
|
|||
acceptor: SslAcceptor,
|
||||
) -> io::Result<Self> {
|
||||
let factory = self.factory.clone();
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let addr = lst.local_addr().unwrap();
|
||||
self.sockets.push(Socket {
|
||||
addr,
|
||||
|
@ -937,7 +937,7 @@ where
|
|||
use actix_rt::net::UnixStream;
|
||||
use actix_service::{fn_service, ServiceFactoryExt as _};
|
||||
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let factory = self.factory.clone();
|
||||
let socket_addr =
|
||||
net::SocketAddr::new(net::IpAddr::V4(net::Ipv4Addr::new(127, 0, 0, 1)), 8080);
|
||||
|
@ -982,7 +982,7 @@ where
|
|||
use actix_rt::net::UnixStream;
|
||||
use actix_service::{fn_service, ServiceFactoryExt as _};
|
||||
|
||||
let cfg = self.config.clone();
|
||||
let cfg = Arc::clone(&self.config);
|
||||
let factory = self.factory.clone();
|
||||
let socket_addr =
|
||||
net::SocketAddr::new(net::IpAddr::V4(net::Ipv4Addr::new(127, 0, 0, 1)), 8080);
|
||||
|
|
|
@ -153,6 +153,9 @@ tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
|
|||
zstd = "0.13"
|
||||
tls-rustls-0_23 = { package = "rustls", version = "0.23" } # add rustls 0.23 with default features to make aws_lc_rs work in tests
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[[example]]
|
||||
name = "client"
|
||||
required-features = ["rustls-0_23-webpki-roots"]
|
||||
|
|
|
@ -173,12 +173,15 @@ where
|
|||
};
|
||||
|
||||
// acquire an owned permit and carry it with connection
|
||||
let permit = inner.permits.clone().acquire_owned().await.map_err(|_| {
|
||||
ConnectError::Io(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"failed to acquire semaphore on client connection pool",
|
||||
))
|
||||
})?;
|
||||
let permit = Arc::clone(&inner.permits)
|
||||
.acquire_owned()
|
||||
.await
|
||||
.map_err(|_| {
|
||||
ConnectError::Io(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"failed to acquire semaphore on client connection pool",
|
||||
))
|
||||
})?;
|
||||
|
||||
let conn = {
|
||||
let mut conn = None;
|
||||
|
|
|
@ -49,7 +49,7 @@ impl FrozenClientRequest {
|
|||
where
|
||||
B: MessageBody + 'static,
|
||||
{
|
||||
RequestSender::Rc(self.head.clone(), None).send_body(
|
||||
RequestSender::Rc(Rc::clone(&self.head), None).send_body(
|
||||
self.addr,
|
||||
self.response_decompress,
|
||||
self.timeout,
|
||||
|
@ -60,7 +60,7 @@ impl FrozenClientRequest {
|
|||
|
||||
/// Send a json body.
|
||||
pub fn send_json<T: Serialize>(&self, value: &T) -> SendClientRequest {
|
||||
RequestSender::Rc(self.head.clone(), None).send_json(
|
||||
RequestSender::Rc(Rc::clone(&self.head), None).send_json(
|
||||
self.addr,
|
||||
self.response_decompress,
|
||||
self.timeout,
|
||||
|
@ -71,7 +71,7 @@ impl FrozenClientRequest {
|
|||
|
||||
/// Send an urlencoded body.
|
||||
pub fn send_form<T: Serialize>(&self, value: &T) -> SendClientRequest {
|
||||
RequestSender::Rc(self.head.clone(), None).send_form(
|
||||
RequestSender::Rc(Rc::clone(&self.head), None).send_form(
|
||||
self.addr,
|
||||
self.response_decompress,
|
||||
self.timeout,
|
||||
|
@ -86,7 +86,7 @@ impl FrozenClientRequest {
|
|||
S: Stream<Item = Result<Bytes, E>> + 'static,
|
||||
E: Into<BoxError> + 'static,
|
||||
{
|
||||
RequestSender::Rc(self.head.clone(), None).send_stream(
|
||||
RequestSender::Rc(Rc::clone(&self.head), None).send_stream(
|
||||
self.addr,
|
||||
self.response_decompress,
|
||||
self.timeout,
|
||||
|
@ -97,7 +97,7 @@ impl FrozenClientRequest {
|
|||
|
||||
/// Send an empty body.
|
||||
pub fn send(&self) -> SendClientRequest {
|
||||
RequestSender::Rc(self.head.clone(), None).send(
|
||||
RequestSender::Rc(Rc::clone(&self.head), None).send(
|
||||
self.addr,
|
||||
self.response_decompress,
|
||||
self.timeout,
|
||||
|
|
|
@ -100,8 +100,6 @@
|
|||
//! # }
|
||||
//! ```
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![allow(unknown_lints)] // temp: #[allow(non_local_definitions)]
|
||||
#![allow(
|
||||
clippy::type_complexity,
|
||||
|
|
|
@ -78,7 +78,7 @@ where
|
|||
RedirectServiceFuture::Tunnel { fut }
|
||||
}
|
||||
ConnectRequest::Client(head, body, addr) => {
|
||||
let connector = self.connector.clone();
|
||||
let connector = Rc::clone(&self.connector);
|
||||
let max_redirect_times = self.max_redirect_times;
|
||||
|
||||
// backup the uri and method for reuse schema and authority.
|
||||
|
|
Loading…
Reference in a new issue