diff options
author | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2021-04-18 03:47:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-18 03:47:23 +0000 |
commit | c368a113957d42666f080303783174e4adaf02b4 (patch) | |
tree | 96349d7f01be73cf6f80962bf34a9af543c2971c /src/file_upload.rs | |
parent | Don't use different syle for symlink symbol (diff) | |
parent | Update README for separate .tar and .tar.gz flags (diff) | |
download | miniserve-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.rs | 4 |
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) { |