1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-25 23:09:22 +00:00

Improve code readability

This commit is contained in:
Pierre HUBERT 2022-03-17 18:15:29 +01:00
parent 5c938dccd1
commit 3c202d7afa

View File

@ -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() {