Fix cargo clippy issues
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-08-28 08:05:22 +02:00
parent cd4b8af445
commit a1e23efd99
8 changed files with 110 additions and 114 deletions

View File

@@ -31,12 +31,12 @@ pub async fn upload(MultipartForm(mut form): MultipartForm<UploadDiskImageForm>)
}
// Check file mime type
if let Some(mime_type) = file.content_type {
if !constants::ALLOWED_DISK_IMAGES_MIME_TYPES.contains(&mime_type.as_ref()) {
return Ok(HttpResponse::BadRequest().json(format!(
"Unsupported file type for disk upload: {mime_type}"
)));
}
if let Some(mime_type) = file.content_type
&& !constants::ALLOWED_DISK_IMAGES_MIME_TYPES.contains(&mime_type.as_ref())
{
return Ok(HttpResponse::BadRequest().json(format!(
"Unsupported file type for disk upload: {mime_type}"
)));
}
// Extract and check file name