1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-20 09:18:26 +00:00

Fix type confusion in some scenarios

When the feature for rustls 0.22 is enabled, and rustls 0.23 is also
present in a project, there suddently exist multiple paths for errors
when building middleware chains due to the use of two consecutive `?`
operators without specifying the intermediate error type.

This commit addresses the issue by removing the first `?`, so that the
first error type will always be known, and the second `?` always has a
well defined implementation.
This commit is contained in:
asonix 2024-05-03 14:03:17 -05:00
parent babac131d4
commit bb7a772667
2 changed files with 6 additions and 4 deletions

View file

@ -263,8 +263,9 @@ impl ServiceFactory<ServiceRequest> for AppRoutingFactory {
let guards = guards.borrow_mut().take().unwrap_or_default();
let factory_fut = factory.new_service(());
async move {
let service = factory_fut.await?;
Ok((path, guards, service))
factory_fut
.await
.map(move |service| (path, guards, service))
}
}));

View file

@ -470,8 +470,9 @@ impl ServiceFactory<ServiceRequest> for ScopeFactory {
let guards = guards.borrow_mut().take().unwrap_or_default();
let factory_fut = factory.new_service(());
async move {
let service = factory_fut.await?;
Ok((path, guards, service))
factory_fut
.await
.map(move |service| (path, guards, service))
}
}));