diff options
author | Alec Di Vito <me@alecdivito.com> | 2025-03-02 19:46:10 +0000 |
---|---|---|
committer | Alec Di Vito <me@alecdivito.com> | 2025-03-02 19:46:10 +0000 |
commit | 33c79837f1e113a1ce83a461413acf474e973c63 (patch) | |
tree | f1745dccd93f05fbb8a9920233ddef33bfe8963f /src/config.rs | |
parent | feat: address comments; add in new argument (`temp-directory`); add comments ... (diff) | |
download | miniserve-33c79837f1e113a1ce83a461413acf474e973c63.tar.gz miniserve-33c79837f1e113a1ce83a461413acf474e973c63.zip |
feat: validate temp dir exists through `value_parser` and fixed clippy issues
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/config.rs b/src/config.rs index 6a048c2..4404959 100644 --- a/src/config.rs +++ b/src/config.rs @@ -278,16 +278,10 @@ impl MiniserveConfig { .transpose()? .unwrap_or_default(); - let temp_upload_directory = args.temp_upload_directory.as_ref().take().map(|v| if v.exists() && v.is_dir() { - Ok(v.clone()) - } else { - Err(anyhow!("Upload temporary directory must exist and be a directory. Validate that path {v:?} meets those requirements")) - }).transpose()?; - Ok(Self { verbose: args.verbose, path: args.path.unwrap_or_else(|| PathBuf::from(".")), - temp_upload_directory, + temp_upload_directory: args.temp_upload_directory, port, interfaces, auth, |