diff --git a/examples/stream-to-file/src/main.rs b/examples/stream-to-file/src/main.rs index 02164d4e..f3263c4d 100644 --- a/examples/stream-to-file/src/main.rs +++ b/examples/stream-to-file/src/main.rs @@ -86,7 +86,7 @@ async fn show_form() -> Html<&'static str> { // Handler that accepts a multipart form upload and streams each field to a file. async fn accept_form(mut multipart: Multipart) -> Result { - while let Some(field) = multipart.next_field().await.unwrap() { + while let Ok(Some(field)) = multipart.next_field().await { let file_name = if let Some(file_name) = field.file_name() { file_name.to_owned() } else {