From 77fded2ea26133c365d2f715f209924a5101a77b Mon Sep 17 00:00:00 2001 From: Romain Lebran Date: Tue, 13 Jun 2023 09:23:39 +0200 Subject: [PATCH] Remove unwrap from multipart server.rs --- actix-multipart/src/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actix-multipart/src/server.rs b/actix-multipart/src/server.rs index 9babe31a0..3d591ddfe 100644 --- a/actix-multipart/src/server.rs +++ b/actix-multipart/src/server.rs @@ -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)