mirror of
https://github.com/MedzikUser/HomeDisk.git
synced 2024-08-14 21:46:53 +00:00
fix(clippy): fix warnings
Delete unneedede borrowed expression.
This commit is contained in:
parent
4dd9013521
commit
8a8b8b0f12
2 changed files with 3 additions and 3 deletions
|
@ -29,9 +29,9 @@ pub async fn delete(
|
||||||
}
|
}
|
||||||
|
|
||||||
if path.is_dir() {
|
if path.is_dir() {
|
||||||
fs::remove_dir(&path).map_err(|_| Error::DeleteDirectory)?;
|
fs::remove_dir(path).map_err(|_| Error::DeleteDirectory)?;
|
||||||
} else {
|
} else {
|
||||||
fs::remove_file(&path).map_err(|_| Error::DeleteFile)?;
|
fs::remove_file(path).map_err(|_| Error::DeleteFile)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Json(Response { success: true }))
|
Ok(Json(Response { success: true }))
|
||||||
|
|
|
@ -34,7 +34,7 @@ pub async fn upload(
|
||||||
// e.g. path ==> `/secret/files/images/screenshot.png`
|
// e.g. path ==> `/secret/files/images/screenshot.png`
|
||||||
// directories up to `{storage dir}/{username}/secret/files/images/` will be created
|
// directories up to `{storage dir}/{username}/secret/files/images/` will be created
|
||||||
if let Some(prefix) = path.parent() {
|
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
|
let field = multipart
|
||||||
|
|
Loading…
Reference in a new issue