aboutsummaryrefslogtreecommitdiffstats
path: root/src/file_upload.rs
diff options
context:
space:
mode:
authorAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2021-04-18 03:47:23 +0000
committerGitHub <noreply@github.com>2021-04-18 03:47:23 +0000
commitc368a113957d42666f080303783174e4adaf02b4 (patch)
tree96349d7f01be73cf6f80962bf34a9af543c2971c /src/file_upload.rs
parentDon't use different syle for symlink symbol (diff)
parentUpdate README for separate .tar and .tar.gz flags (diff)
downloadminiserve-c368a113957d42666f080303783174e4adaf02b4.tar.gz
miniserve-c368a113957d42666f080303783174e4adaf02b4.zip
Merge branch 'master' into rfc-resolve-symlinks
Diffstat (limited to 'src/file_upload.rs')
-rw-r--r--src/file_upload.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/file_upload.rs b/src/file_upload.rs
index 785d72f..93b7109 100644
--- a/src/file_upload.rs
+++ b/src/file_upload.rs
@@ -20,9 +20,7 @@ fn save_file(
overwrite_files: bool,
) -> Pin<Box<dyn Future<Output = Result<i64, ContextualError>>>> {
if !overwrite_files && file_path.exists() {
- return Box::pin(future::err(ContextualError::CustomError(
- "File already exists, and the overwrite_files option has not been set".to_string(),
- )));
+ return Box::pin(future::err(ContextualError::DuplicateFileError));
}
let mut file = match std::fs::File::create(&file_path) {