diff --git a/server/src/fs/upload.rs b/server/src/fs/upload.rs index cd4941c..8211d55 100644 --- a/server/src/fs/upload.rs +++ b/server/src/fs/upload.rs @@ -50,10 +50,9 @@ pub async fn handle( // create a directory where the file will be placed // e.g. path ==> `/secret/files/images/screenshot.png` // directories up to `{storage dir}/{username}/secret/files/images/` will be created - match file_path.parent() { - Some(prefix) => fs::create_dir_all(&prefix) - .map_err(|err| ServerError::FsError(FsError::CreateFile(err.to_string())))?, - None => (), + if let Some(prefix) = file_path.parent() { + fs::create_dir_all(&prefix) + .map_err(|err| ServerError::FsError(FsError::CreateFile(err.to_string())))? } // get multipart field