fix(clippy): fix warnings

Delete unneedede borrowed expression.
This commit is contained in:
MedzikUser 2022-09-14 19:56:53 +02:00
parent 4dd9013521
commit 8a8b8b0f12
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
2 changed files with 3 additions and 3 deletions

View File

@ -29,9 +29,9 @@ pub async fn delete(
}
if path.is_dir() {
fs::remove_dir(&path).map_err(|_| Error::DeleteDirectory)?;
fs::remove_dir(path).map_err(|_| Error::DeleteDirectory)?;
} else {
fs::remove_file(&path).map_err(|_| Error::DeleteFile)?;
fs::remove_file(path).map_err(|_| Error::DeleteFile)?;
}
Ok(Json(Response { success: true }))

View File

@ -34,7 +34,7 @@ pub async fn upload(
// e.g. path ==> `/secret/files/images/screenshot.png`
// directories up to `{storage dir}/{username}/secret/files/images/` will be created
if let Some(prefix) = path.parent() {
fs::create_dir_all(&prefix).map_err(|_| Error::CreateDirectory)?
fs::create_dir_all(prefix).map_err(|_| Error::CreateDirectory)?
}
let field = multipart