mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
Fix type confusion in some scenarios (#3348)
* 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. * Add CHANGES entry about type confusion --------- Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
parent
3c9a930bd1
commit
33c47c0ba9
@ -9,6 +9,7 @@
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Minimum supported Rust version (MSRV) is now 1.72.
|
- Minimum supported Rust version (MSRV) is now 1.72.
|
||||||
|
- Avoid type confusion in rare circumstances
|
||||||
|
|
||||||
## 4.5.1
|
## 4.5.1
|
||||||
|
|
||||||
|
@ -263,8 +263,9 @@ impl ServiceFactory<ServiceRequest> for AppRoutingFactory {
|
|||||||
let guards = guards.borrow_mut().take().unwrap_or_default();
|
let guards = guards.borrow_mut().take().unwrap_or_default();
|
||||||
let factory_fut = factory.new_service(());
|
let factory_fut = factory.new_service(());
|
||||||
async move {
|
async move {
|
||||||
let service = factory_fut.await?;
|
factory_fut
|
||||||
Ok((path, guards, service))
|
.await
|
||||||
|
.map(move |service| (path, guards, service))
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -470,8 +470,9 @@ impl ServiceFactory<ServiceRequest> for ScopeFactory {
|
|||||||
let guards = guards.borrow_mut().take().unwrap_or_default();
|
let guards = guards.borrow_mut().take().unwrap_or_default();
|
||||||
let factory_fut = factory.new_service(());
|
let factory_fut = factory.new_service(());
|
||||||
async move {
|
async move {
|
||||||
let service = factory_fut.await?;
|
factory_fut
|
||||||
Ok((path, guards, service))
|
.await
|
||||||
|
.map(move |service| (path, guards, service))
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user