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

Remove unwrap from multipart server.rs

This commit is contained in:
Romain Lebran 2023-06-13 09:23:39 +02:00
parent 9cc7f620aa
commit 77fded2ea2
No known key found for this signature in database
GPG key ID: 30617CD7C6872017

View file

@ -643,7 +643,7 @@ impl InnerField {
return Poll::Ready(None);
}
let result = if let Some(mut payload) = self.payload.as_ref().unwrap().get_mut(s) {
let result = if let Some(mut payload) = self.payload.as_ref().and_then(|p| p.get_mut(s)) {
if !self.eof {
let res = if let Some(ref mut len) = self.length {
InnerField::read_len(&mut payload, len)