diff --git a/src/server.rs b/src/server.rs index 089fa03..e92249f 100644 --- a/src/server.rs +++ b/src/server.rs @@ -159,8 +159,8 @@ impl FromRequest for CustomRequest { let mut field = el?; let content_type = field.content_disposition().clone(); - let name = content_type.get_name().ok_or( - ErrorInternalServerError("Missing field name!"))?; + let name = content_type.get_name(). + ok_or_else(|| ErrorInternalServerError("Missing field name!"))?; // Handle file upload if content_type.get_filename().is_some() {