mirror of
https://github.com/tokio-rs/axum.git
synced 2025-04-26 13:56:22 +02:00
Remove unwrap from example-stream-to-file
This commit is contained in:
parent
99e8828df5
commit
f4accdc95d
1 changed files with 1 additions and 1 deletions
|
@ -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<Redirect, (StatusCode, String)> {
|
||||
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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue