1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-17 13:46:36 +00:00

Remove unwrap from multipart ?

Cleanup more unwrap. Switch inner field from Rc to Arc

Wrap with mutex instead of refcell

Arc for safety

Revert "Arc for safety"

This reverts commit d4262c76934b5b22237f4ba0202da34f76ec1456.

Revert "Wrap with mutex instead of refcell"

This reverts commit 5c0645efb4a66c8f24257244c9f0cd4201863733.

Revert "Cleanup more unwrap. Switch inner field from Rc to Arc"

This reverts commit fb6175d618d4ceae28a207a5e6a9c68ff8ded18d.
This commit is contained in:
Romain Lebran 2023-06-09 17:06:28 +02:00
parent 37d304b0f2
commit 9cc7f620aa
No known key found for this signature in database
GPG key ID: 30617CD7C6872017

View file

@ -465,7 +465,7 @@ impl Stream for Field {
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
let this = self.get_mut();
let mut inner = this.inner.borrow_mut();
if let Some(mut buffer) = inner.payload.as_ref().unwrap().get_mut(&this.safety) {
if let Some(mut buffer) = inner.payload.as_ref().and_then(|p| p.get_mut(&this.safety)) {
// check safety and poll read payload to buffer.
buffer.poll_stream(cx)?;
} else if !this.safety.is_clean() {